Comparing strings in java android -


how compare string

http://192.168.74.1/sp/info.php?prodnum=0000000001 

with

http://192.168.74.1 

i need http://192.168.74.1 part of first string.

you don't need extract first string. can use string.startswith:

if (string1.startswith(string2)) {   // } 

Comments