How to search word by word in android

后端 未结 5 2063
我在风中等你
我在风中等你 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 09:18

    use indexOf:

    int i= string.indexOf('1'); 
    

    or substring:

    String s=string.substring("koko",0,1);
    

提交回复
热议问题