标签:++ color i++ oid while java print rgs 字符串
public class CharAt { public static void main(String[] args) { String ac = "Hello World"; //for (int i = 0; i < ac.length(); i++) int i = 0; //while (i < ac.length()) do { System.out.println(ac.charAt(i)); if (ac.charAt(i) == ‘o‘) break; i++; } while (i < ac.length()); } }
.length(), .charAt()
熟悉三种循环
do-while
while
for
[Java]遍历字符串.length(), .charAt()
标签:++ color i++ oid while java print rgs 字符串
原文地址:https://www.cnblogs.com/profesor/p/13058977.html