标签: java
例如,如果一个人输入了数字22,44,55,33,77,443。它会打印出#6;已输入6个数字"。
答案 0 :(得分:1)
也许您正在寻找String.split,例如:
String.split
String input = "22,44,55,33,77,443"; System.out.printf("%d numbers have been entered\n", input.split(",").length);