Thomas SMETS
Posts: 307
Nickname: tsmets
Registered: Apr, 2002
|
|
Re: i want to compare a character of a string
|
Posted: Apr 8, 2002 6:36 AM
|
|
Patrick, This is definitively not clear ! Please explain more thoroughly what U want or ....
String s;
char ch; // character to find
for (int i = 0; i < s.length(); i++)
{
if (s.lastIndexOf(ch) != -1)
doSmthg();
else
doSomeOtherThing();
}
Please note that java.lang.String contains that many API's that this is only one possible solution !
Thomas, tsmets @ lautre . net
|
|