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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -