How to get prefix string value in Android? [closed]
Asked Answered
A

1

5

i am working in Android application, Using hasPrefix to get a first string value in iphone, but i didn't know how to do this? please help me

In iphone:

Name =@"Thomas edward";
if ([result hasPrefix:Thomas])  
{

}

Similarly Android, how to do this?

Thanks in advance

Antifouling answered 16/8, 2012 at 13:17 Comment(1)
It is a rather basic Java question. It is very likely that you didn't ask Google.Riffe
F
11

You can use startsWith, or check the index of the string

if(result.startsWith("Thomas")) 
{

}
Foregone answered 16/8, 2012 at 13:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.