Quantcast
Channel: Java OR operator in if string contains statement - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Java OR operator in if string contains statement

$
0
0

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 contain Vertex, Name or Transmittance I want it to print out. However Im getting a compilation error saying that the || operator is undefined for the argument types. I'm relatively new to programming so Im not sure what this means could someone kindly point in the right direction on how to fix my code?


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>