2日目 段階4 小澤

StringCheckが段階3までで使用していたクラスで、StringCheckRefが段階4で書き直したものです。
This commit is contained in:
2026-09-09 15:26:34 +09:00
parent 2577de18bc
commit 84efe9398b
2 changed files with 42 additions and 8 deletions

View File

@@ -10,9 +10,7 @@ public class StringCheck {
comment[2] = "投稿文が長すぎます";
comment[3] = "\"↓↓↓↓↓↓ 投稿されました ↓↓↓↓↓↓\"";
// for (String testComm : comment) {
// System.out.println(testComm);
// }
while (true) {
System.out.println(comment[0]);
@@ -20,12 +18,9 @@ public class StringCheck {
String text = scanner.nextLine();
String str = text.strip();
// System.out.println(str.length() == 0);
// System.out.println(str.length() > 140);
//
// System.out.println(140 - str.length());
if(str.length() < 1) {
if(str.length() == 0) {
System.out.println("何も入力されていません");
continue;
}else if(str.length() > 140){