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