I have a user input their name as a string and then the name is printed out onto the screen. How can i limit what is printed to only 12 characters so that a user cannot type an insanely long name? Here is my code:
Scanner input = new Scanner(System.in);
System.out.print("Enter your player name: ");
String name= input.next();
System.out.print("\n" + name + " has started the game\n");