📜  Java循环字符串 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:28.485000             🧑  作者: Mango

代码示例3
String s = "Techie Delight";

// convert string to `char[]` array
char[] chars = s.toCharArray();

// iterate over `char[]` array using enhanced for-loop
for (char ch: chars) {
    System.out.print(ch);
}