+ 2
I want to check if a string contains a list of letters how can i do that ?
9 Answers
+ 1
Let's say you have a list with some Strings in it:
for(String s : list){
if(yourString.contains(s){
//do something
}
}
+ 4
Denise RoĆberg how can we do this with regex??
+ 4
Denise RoĆberg thanks was so good learned more than just regex.
+ 2
thx bro
+ 2
hamid
I hope this tutorial helps you:
http://tutorials.jenkov.com/java-regex/matcher.html
+ 1
Hello Grandizer
String has a contains() method. It returns true or false if a String contains a letter or a sequence.
. contains ("a")
.contains("abc")
You only need to be careful with upper- and lowercase. (a != A)
+ 1
Denise RoĆberg
Ooh
I was thinking of a method that check the string if it had a list of letters .
And i can control the list
+ 1
In this case you need a loop for each letter from the list.
+ 1
Denise RoĆberg
How to compare between a the list and string