所以我想从字母表中删除 modifiedKeyword (PLAIN_ALPHA 用作常量)
private String removeKeyword(String modifiedKeyword){
int wordLength = modifiedKeyword.length();
int letterPosition;
int alphabetPosition;
String modifiedAlphabet = "";
final String PLAIN_ALPHA = "bcdefghijklmnopqrstuvwxyz";
for (alphabetPosition=0; alphabetPosition<=26; letterPosition++){
boolean shouldBeDeleted = false;
char alphabetLetter = PLAIN_ALPHA.charAt(alphabetPosition);
for (letterPosition=0; letterPosition>wordLength; letterPosition++){
char keywordLetter = modifiedKeyword.charAt(letterPosition);
if (alphabetLetter == keywordLetter) { shouldBeDeleted = true;}
modifiedAlphabet += alphabetLetter;
}
}
return modifiedAlphabet;
}
出于某种原因,当我运行它时,它不会执行,而是会一直加载(鼠标光标显示加载动画)。你们能发现我必须错过的任何错误吗?谢谢。