0
0

More than 3 years have passed since last update.

java 固定長文字列の中身の有無を調べる方法

Posted at
        String sti = "     ";
        //スペースをtrimする
        //その結果、ブランクであるかどうか
        if(sti.trim().isEmpty()) {
            System.out.println("blank");
        }else {
            System.out.println("notBlank");
        }
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0