vendredi 5 février 2021

checking if statemend about Character in String JAVA

I have a little problem that I cannot understand , why this code underline on red the "UsernameValidation" which say that this must return a String I've return string but its not count for some reason Thanks for help

public static String UsernameValidation(String str){ 
  if ((str.length()>20 || (str.length()<3))){
      if(str.endsWith("_")){
          if(Character.isDigit(str.charAt(0))){
            str = "False";
            return str;
          }else{
              str = "True";
              return str;
          }
       }
  }      

}

Aucun commentaire:

Enregistrer un commentaire