↧
Answer by Alex G for Java OR operator in if string contains statement
try to use this code public static void main(String[] args) { List<String> verticesposition2 = new ArrayList<String>(); verticesposition2.add("safdsfVertex");...
View ArticleAnswer by Evan Knowles for Java OR operator in if string contains statement
The || operator works on individual boolean terms, not to provide a bunch of different arguments.if((!str5.contains("Vertex")||!str5.contains("Name")||!str5.contains("Transmittance")){
View ArticleAnswer by Bohemian for Java OR operator in if string contains statement
Java doesn't have a syntax like that, but you can put the "or" in a regex:if (!str5.matches(".*(Vertex|Name|Transmittance).*")) {Note that java's matches() (unlike many other languages) must match the...
View ArticleJava OR operator in if string contains statement
I have the following code.for (String str5 : verticesposition2) { if(!str5.contains(("Vertex")||("Name")||("Transmittance")) { System.out.println(str5); } }As you can see above if the string does NOT...
View Article