Trying to get a message to appear that is exactly 10 characters long. Can someone point me in the right direction of what to do when the message is SHORTER than 10 characters?
Here is my code so far:
System.out.println("Word:");
String word = scan.nextLine();
String shortword = word.substring(0, 10);
String shortworduppercase = shortword.toUpperCase();
System.out.println(shortworduppercase);
I know it has something to do with padRight but I can't seem to get anything to work.