我试图拿一个完整的字符串,并使用索引来打印它的每个部分。 我一直是这样的......分隔一个索引为
String example = "one, two, three, four"
int comma = example.indexOf(',' , 0);
String output = example.substring(comma);
System.out.println(output);
这将打印
,two,three,four
我不能让它做别的......
您需要使用'loop'。 –