Answers for "java code to input non blank string"

0

java code to input non blank string

public static String inputNonBlankStr(String msg){//your message ex:"Enter non blank string:
        String data;
        do{
            System.out.println(msg);
            data = sc.nextLine();
        }while(data.isEmpty());
        return data;
    }
Posted by: Guest on September-14-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language