I want my String in Java to end up being a multiple of 5 by adding X's to it:
Example 1:
"ABCDEFGHIJK" // length 11
I want to add 4 "X" to the end:
"ABCDEFGHIJKXXXX" // length 15
Example 2:
"ABCDEFGHI" // length 9
I want to add 1 "X" to the end
"ABCDEFGHIX" // length 10
How can I do this? Thanks for any help!
EDIT: Yes I did code some I just forgot to put it in my question
int myInitialAmountOfX = myString.length() % 5;
System.out.println(myInitialAmountOfX);
int myTotalAmountOfX = 5 - myInitialAmountOfX;
Was just confused on how to append.