protected void intFinder(int k, String inputLine) {
int legnth = inputLine.length();
Integer extractedNumber = null;
for (int i = 0; i < legnth; i++) {
Character character = inputLine.charAt(i);
if (character.equals(":")) {
i++;
extractedNumber += character;
character = inputLine.charAt(i);
} else if (character.equals(",")) {
i++;
character = inputLine.charAt(i);
while (Character.isDigit(character)) {
extractedNumber += character;
i++;
character = inputLine.charAt(i);
}
//code ommited
我想3字節是字母和數字的混合字符串,例如avfds:10,5,14但如果character.equals(「 :「)永遠不會顯示爲真實,我不知道爲什麼。感謝您的幫助使用數字和字母在字符串中提取整數
INT k爲以後使用的開關在使用字符不應該在這一點上
'等於()'通常是「類意識」等等'String'絕不等於'Character' – 2013-12-09 17:46:41