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++;
}