트윗에 해시 태그 또는 언급이 있는지 확인하고 다음에 공백이나 탭이 있으면 확인하지 않을 기본 코드를 작성하고 있습니다. 나는 또한 'unclosed character literal'메시지를 받고 있는데, 왜 그런지 잘 모르겠습니다.Error - StringIndexOutOfBoundsException : 문자열 인덱스가 범위를 벗어났습니다. 4
for (int i=0; i < tweet.length(); i++) {
char currentchar = tweet.charAt(i);
char nextcar = tweet.charAt(i+1);
if (currentchar == '#') {
if (! (nextcar == ' ') && ! (nextcar == '/t')) {
numofhashtags++;
}
}
if (currentchar == '@') {
if ((nextcar != ' ') && (nextcar != '/t')) {
numofmentions++;
}
}
}
'내가
Tom
오류 메시지의 의미를 이해합니까? –