1
簡單替代密碼。簡單替代密碼
我試圖做一個循環構造,將循環通過一個字符串,並在同一時間寫入到另一個字符串。遇到空間時,我無法跳過它。有人能幫我解決這個問題嗎?
String translate = "";//create empty string
int xxx = 0; //initialise counter
while(xxx < text.length()) { //based on the original length of input text
if (text.charAt(xxx) != ' '){ //if no white space do this
translate = translate.concat(Character.toString((s2.charAt(copyS.indexOf(text.charAt(xxx))))));
} else { //if there is white space do this. (I'm unsure how to make it skip?)
}
xxx++;
}