編集の要約なし
編集の要約なし
2行目: 2行目:
public boolean isEmpty()
public boolean isEmpty()


空文字か真偽します。length()が0の場合にのみ true を返します。
空文字か真偽します。length()が0の場合にのみtrueを返します。


  if (s1.isEmpty()) {
  if (s1.isEmpty()) {
     System.out.println("true");
     System.out.println("true");
  }
  }

2019年6月9日 (日) 12:09時点における版

(String).isEmpty [1]
public boolean isEmpty()

空文字か真偽します。length()が0の場合にのみtrueを返します。

if (s1.isEmpty()) {
    System.out.println("true");
}