Java charAt() 方法
charAt() 方法用于返回指定索引处的字符。索引范围为从 0 到 length() - 1。
语法
public char charAt(int index)
参数
index -- 字符的索引。
返回值
返回指定索引处的字符。
实例
实例
public class Test {
public static void main(String args[]) {
String s = "www.facesoho.com";
char result = s.charAt(9);
System.out.println(result);
}
}
public static void main(String args[]) {
String s = "www.facesoho.com";
char result = s.charAt(9);
System.out.println(result);
}
}
以上程序执行结果为:
o
尊贵的董事大人
英文标题不为空时 视为本栏投稿
需要关键字 描述 英文标题