Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

contains() method

alleyJan 5 2009 — edited Jan 5 2009
Hello,

I'm using the contains() method to check if a String contains a particular substring. I'm using this successfully with JRE1.6.

However, my program has to be run on JRE1.5. When trying the code with this version, it gives me an error:

"cannot resolve symbol" - method contains (java.lang.String)

I checked the 1.5 API, and it seems that the contains() method takes a CharSequence and not a String.

Can you help me solve this problem?

Thanks for your help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 2 2009
Added on Jan 5 2009
12 comments
377 views