总结:charAt()是返回字符型,把字符串拆分成某个字符,返回指定位置的字符。可以把字符串看成char型数组

package com.sads;
///输出一个大写英文字母的
public class XIE {
	public static void main(String[] args) {
		String s="hello world i lkie fjds";
		char c=s.charAt(6);
		System.out.println(c);// 该字符串返回第几个索引的字符
		char[] x=s.toCharArray();//你妹自动纠错,是数组,不是char类型
		System.out.println(x);
		
	}
}
w
hello world i lkie fjds

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-09-09
猜你喜欢
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案