Day 2 Stept 3
This commit is contained in:
@@ -14,13 +14,18 @@ public class StringCheck {
|
||||
// 段階1: 無限ループ化
|
||||
while (true) {
|
||||
System.out.println(messages[0]);
|
||||
str = scan.nextLine().trim();
|
||||
str = scan.nextLine();
|
||||
//str = scan.nextLine().trim();
|
||||
str = str.replaceAll("[\\s ]", "");
|
||||
//String str1 = str.replaceAll("[ ]", "");
|
||||
|
||||
//System.out.println("あなたの入力は: [" + str + "]");
|
||||
|
||||
|
||||
|
||||
//2段階のif
|
||||
boolean isEmpty = str.isEmpty();
|
||||
boolean isTooLong = str.length() > 140;
|
||||
|
||||
if(isEmpty) {
|
||||
System.out.println(messages[1]);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user