About 325,000 results
Open links in new tab
  1. How do I determine whether an array contains a particular value in …

    Jul 15, 2009 · I really miss a simple indexOf and contains in java.util.Arrays - which would both contain straightforward loops. Yes, you can write those in 1 minute; but I still went over to …

  2. java - How does a ArrayList's contains () method evaluate objects ...

    Say I create one object and add it to my ArrayList. If I then create another object with exactly the same constructor input, will the contains() method evaluate the two objects to be the same? …

  3. How to check if a String contains another String in a case …

    Sep 18, 2008 · I compare 5 methods. Our containsIgnoreCase () method. By converting both strings to lower-case and call String.contains(). By converting source string to lower-case and …

  4. In Java, how do I check if a string contains a ... - Stack Overflow

    566 This question already has answers here: How to check if a String contains another String in a case insensitive manner in Java? (19 answers)

  5. java - Which String method: "contains" or "indexOf > -1"? - Stack …

    May 23, 2012 · Take a look at the java.lang.String source code. The contains method is implemented using a call to indexOf, so they are essentially the same.

  6. String.contains in Java - Stack Overflow

    Feb 3, 2015 · System.out.println(b); I run the Java code above, the b return true. Since s2 is empty, why does s1 contains s2? I check the Java API, it write: Returns true if and only if this …

  7. How to use regex in String.contains () method in Java

    Dec 12, 2019 · How to use regex in String.contains () method in Java Asked 12 years, 9 months ago Modified 4 years, 11 months ago Viewed 415k times

  8. Java, Simplified check if int array contains int - Stack Overflow

    Aug 18, 2012 · Java, Simplified check if int array contains int Asked 13 years, 3 months ago Modified 4 years ago Viewed 354k times

  9. How to use contains and equalsIgnoreCase in string

    Feb 20, 2013 · Is there a way to check if a string contains something while not being case sensitive? For example: (this code is invalid it's just for you to get a basic understanding of my …

  10. java - String contains - ignore case - Stack Overflow

    Dec 24, 2012 · That method makes an assumption that the length of the matched part of the haystack will be the same number of UTF-16 code units as the length of the needle. So if …