段階3できました
This commit is contained in:
@@ -22,11 +22,28 @@ public class StringCheck {
|
|||||||
//読み込んだ文字列の前後にある空白文字を除去
|
//読み込んだ文字列の前後にある空白文字を除去
|
||||||
System.out.println(str.strip());
|
System.out.println(str.strip());
|
||||||
scan.close();
|
scan.close();
|
||||||
|
|
||||||
|
|
||||||
|
// 文字列の長さを取得
|
||||||
|
int length = str.length();
|
||||||
|
|
||||||
|
|
||||||
|
// 空字判定
|
||||||
|
boolean isEmpty = (length == 0);
|
||||||
|
|
||||||
|
|
||||||
|
// 文字数超過判定
|
||||||
|
boolean isOverLimit = (length > 140);
|
||||||
|
|
||||||
|
|
||||||
|
// 残り入力可能文字数
|
||||||
|
int a = (140 - length);
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println();
|
||||||
|
System.out.println(classNames[3]);
|
||||||
|
System.out.println(str.strip());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user