How to search word by word in android

后端 未结 5 1738
日久生厌
日久生厌 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:15

    use indexOf:

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

    or substring:

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

提交回复
热议问题