0
点赞
收藏
分享

微信扫一扫

遍历字符串每个字符

看山远兮 2022-03-12 阅读 108
   public static void main(String[] args) {
        String str = "123\\n456\\n789\\n+0- qwertyuiopasdfghjklzxcvbnm是谁?!@#";
        for (int i = 0; i < str.length(); i++) {
            System.out.println(str.charAt(i));
        }
    }
举报

相关推荐

0 条评论