Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特定の単語の文字列を検索し、その単語の次の 5 文字を出力したいと考えています。どうすればいいのかわかりません。チュートリアルを検索しようとしましたが、何も見つかりませんでした。
String で indexOf メソッドを使用し、その後の文字に対して substring を実行できます。
int start = yourString.indexOf(searchString); System.out.println(yourString.subString(start + 1, start + 6);