import java.util.*;
import java.io.*;
class Main {
public static String CodelandUsernameValidation(String str) {
// code goes here
if(str.length() < 4 || str.length() > 25 || Character.isLetter(str.charAt(0)) == false || str.charAt(str.length()-1) == '_') {
return "false";
}
else{
for(int i=0;i<str.length();i++){
if(Character.isLetter(str.charAt(i)) || Character.isDigit(str.charAt(i)) || str.charAt(i) == '_'){
continue;
}
else{
return "false";
}
}
}
return "true";
}
public static void main (String[] args) {
// keep this function call here
Scanner s = new Scanner(System.in);
System.out.print(CodelandUsernameValidation(s.nextLine()));
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter