📅  最后修改于: 2022-03-11 14:52:29.303000             🧑  作者: Mango
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;
}