Java经典实例:处理单个字符串
发布日期:2022-02-26 14:49:41 浏览次数:44 分类:技术文章

本文共 399 字,大约阅读时间需要 1 分钟。

/**
 * Created by Frank
 */
public class StrCharAt {
    public static void main(String[] args) {
        String a = "A quick bronze fox lept a lazy bovine";
        for (int i = 0; i < a.length(); i++) {
            System.out.println("Char " + i + " is " + a.charAt(i));
        }
    }
}
public class ForEachChar {
    public static void main(String[] args) {
        String s = "Hello Wold";
        for (char c : s.toCharArray()) {
            System.out.println(c);
        }
    }
}

转载地址:https://blog.csdn.net/qq_31887661/article/details/53080994 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:《初识Scratch》教学设计
下一篇:Java数组排序和查找

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月02日 00时07分15秒