1.9 获取指定位置的字符

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了1.9 获取指定位置的字符相关的知识,希望对你有一定的参考价值。

package Demo;

public class Demo4 {
 public static void main(String[] args) {
  String str = "helloworld";
  System.out.println("字符串的长度为:"+str.length());
  
  for(int i=0;i<str.length();i++){
   System.out.print(str.charAt(i)+"、");
   
   
  }
 }
}

以上是关于1.9 获取指定位置的字符的主要内容,如果未能解决你的问题,请参考以下文章