0
(Java) I need help making to strings equal each other in length ,but I feel like i did my loop wrong
This is my loop I am doing this for the Vigneer Cypher so I am trying to make the strings equal each other in length So i created this loop for(int i = 0;i<plainText.length();i++,j++){ if(j == bellasoStr.length()) j = 0; if(bellasoStr.length()==plainText.length()) break; bellasoStr+=bellasoStr.charAt(j); } However I dont know if I formated or created the loop correct
2 Réponses
+ 2
If you define j = 0 then your code should work.
https://code.sololearn.com/cB1676wGVWLk/?ref=app
+ 1
thanks