編集の要約なし |
編集の要約なし |
||
3行目: | 3行目: | ||
public int indexOf(String str) | public int indexOf(String str) | ||
前から検索して指定文字列が最初に見つかった位置をintで知らせます。位置は0から始まります。 | |||
if (input != null) { | if (input != null) { | ||
System.out.println("position: " + sentence.indexOf(input)); | System.out.println("position: " + sentence.indexOf(input)); | ||
} | } |