Skip to Main Content

New to Java

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!

how to check if String contains a given char?

843785Dec 21 2008 — edited Dec 23 2008
I want to check if my String contains a given letter. If I use a contains(CharSequence s) method it wouldn't compile because char is not a charSequence. Any ideas?
Thanks
private boolean is aInAla()
{

if (Ala.contains(currentLetter)){
return true;}
else{
return false;
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 20 2009
Added on Dec 21 2008
25 comments
30,247 views