📜  java 循环遍历字符串 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:49.587000             🧑  作者: 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);
}