How to search word by word in android

后端 未结 5 1994
我在风中等你
我在风中等你 2021-01-22 08:28

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 08:52

    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

提交回复
热议问题