Day 2 Stept 3

This commit is contained in:
2026-09-09 14:50:54 +09:00
parent 3e40796e6e
commit e8bdd3f18a

View File

@@ -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;