• Advertisement
Sign in to follow this  

[java] strstr equivalent in Java

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, Is there a quick and easy way of searching for occurences of a specific string in another string (just like the standard libraries' strstr())? Thanks

Share this post


Link to post
Share on other sites
Advertisement
a quick look at the docs found String.contains(), and String.indexOf()

Those docs are for Java 5, so double check your docs if you're using a different version.

Share this post


Link to post
Share on other sites
Sadly, I am using (and have to) its predecessor JDK 1.4.2. :(

Any other way?

Share this post


Link to post
Share on other sites
You are right. I can't believe I missed that. Thanks for the help.

Share this post


Link to post
Share on other sites
Quote:

They have a 1.4.2 doc too you know......


I know, hence my comment "I can't believe I missed that".

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement