You are viewing a single comment's thread. Return to all comments →
why is there a compalation error to my solution? do you have it too?
class UsernameValidator { Scanner scan = new Scanner (System.in);
for(int i=0;i<scan.nextInt();i++){ String s=scan.nextLine(); if(s.length()<8 || s.length()>30) System.out.println("Invalid"); else{ if(s.matches("^[a-zA-Z_]+$")) System.out.println("Valid"); else System.out.println("Invalid"); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Valid Username Regular Expression
You are viewing a single comment's thread. Return to all comments →
why is there a compalation error to my solution? do you have it too?
class UsernameValidator { Scanner scan = new Scanner (System.in);