jdk/src/java.base/share/classes/java/lang/String.java
changeset 26451 f86e59f18322
parent 25859 3317bb8137f4
child 26731 abc6b733e3ab
equal deleted inserted replaced
26450:7d90b73e92d4 26451:f86e59f18322
  2117      * @param s the sequence to search for
  2117      * @param s the sequence to search for
  2118      * @return true if this string contains {@code s}, false otherwise
  2118      * @return true if this string contains {@code s}, false otherwise
  2119      * @since 1.5
  2119      * @since 1.5
  2120      */
  2120      */
  2121     public boolean contains(CharSequence s) {
  2121     public boolean contains(CharSequence s) {
  2122         return indexOf(s.toString()) > -1;
  2122         return indexOf(s.toString()) >= 0;
  2123     }
  2123     }
  2124 
  2124 
  2125     /**
  2125     /**
  2126      * Replaces the first substring of this string that matches the given <a
  2126      * Replaces the first substring of this string that matches the given <a
  2127      * href="../util/regex/Pattern.html#sum">regular expression</a> with the
  2127      * href="../util/regex/Pattern.html#sum">regular expression</a> with the