Hi all,
I was rather suprised to find that the String java api doesn't contain String.contains (char aChar) method. It has a similar method for a charsequence but not one for what i need.
So unless someone tells me im wrong I ve come up with a another way.
If i have a char aChar = 'x'
then a String aString = "test"
if i do this aString.indexOf (aChar);
will I either get the index number of aChar or -1 if it isn't in there??
So then i can return false if -1 is returned???
Regards
Brendan
I was rather suprised to find that the String java api doesn't contain String.contains (char aChar) method. It has a similar method for a charsequence but not one for what i need.
So unless someone tells me im wrong I ve come up with a another way.
If i have a char aChar = 'x'
then a String aString = "test"
if i do this aString.indexOf (aChar);
will I either get the index number of aChar or -1 if it isn't in there??
So then i can return false if -1 is returned???
Regards
Brendan
Comment