示例示例charAt() 方法用于返回指定索引处的字符。索引范围为从 0 到 length() -示例:
charAt() 方法用于返回指定索引处的字符。索引范围为从 0 到 length() - 1。
示例:
public class MyClass {
public static void main(String[] args) {
String str = "Hello World";
System.out.println(str.charAt(0));
}
}
// 输出结果:H
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(28条)