一只甜甜圈
用length()方法、charAt方法结合for循环就行了,package com.golden.test;public class TestString { public static void main(String[] args) { String str = "你叫神马?我叫Tesson."; for (int i = 0; i < str.length(); i++) { char item = str.charAt(i); System.out.println(item); } }}