Files
java-cui-string-checker/動作確認メモ.txt
2026-09-08 16:23:01 +09:00

11 lines
677 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

段階2
 以前の講義で行ったScannerでの標準入力を用い
 「 今日は晴れ  」と入力、何も変更していないのでそのまま出力
 Stringクラスで何かメソッドないかと思い、スペースで検索した
 trimメソッドが該当してそうなので追加しテスト
 「 今日は晴れ  」と入力、「今日は晴れ」と出力
 上は認識ミス、
 このままだと全角スペースが消えないと指摘
 trimの下にstrip
値がこの文字列であり、先頭と末尾のすべてのwhite spaceが削除されている文字列を返します。
 これに変更したところ成功