How to search word by word in android

后端 未结 5 1733
日久生厌
日久生厌 2021-01-22 08:20

How to search a word in a string?

For example

String text = \"Samsung Galaxy S Two\";

If I use text.contains(\"???\");<

5条回答
  •  不知归路
    2021-01-22 09:02

    For most simple usage, you can use a StringTokenizer Look at this link. http://docs.oracle.com/javase/1.4.2/docs/api/java/util/StringTokenizer.html

    For using Regular expressions, Look at Patterns in android. http://developer.android.com/reference/java/util/regex/Pattern.html

提交回复
热议问题