「Java」charAt()で文字列を取得するサンプル

書式
public char charAt(int index)

サンプルコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
public class Demo {
public static void main(String[] args) {
String cft= "this is a test data";
System.out.println(cft.charAt(2));
}
}
public class Demo { public static void main(String[] args) { String cft= "this is a test data"; System.out.println(cft.charAt(2)); } }
public class Demo {
  public static void main(String[] args) {
    String cft= "this is a test data";
    System.out.println(cft.charAt(2)); 
  }
}

 

Java

Posted by arkgame