Hello I need to do a cipher function and I need a result like this: Ex: String "Hello Java" , int 3
Hell
o-Ja
va
And I need to replace the 3 letters in each loop, but allways print the same letters. And I need a way to do it. thanx
public static String cifradoTrans(String phrase, int N){
String output= "";
char[] letter= phrase.toCharArray();
for(int j =0; j<letter.length;j++){
for(int i =0; i<N; i++){
System.out.print(letter[i]);
}
System.out.println("");
}
return output;
}