ページの作成:「(String).endsWith [https://docs.oracle.com/javase/jp/8/docs/api/java/lang/String.html#endsWith-java.lang.String-]<br> public boolean matches(String regex) この文…」
(相違点なし)

2019年5月31日 (金) 09:43時点における版

(String).endsWith [1]
public boolean matches(String regex)

この文字列が、指定された接尾辞で終るかどうかを判定します。

if (input.matches("ho[gbw]e")) {
    System.out.println("It matches!");
}