About 53 results
Open links in new tab
  1. What does String.substring exactly do in Java? - Stack Overflow

    May 31, 2012 · I always thought if I do String s = "Hello World".substring(0, 5), then I just get a new string s = "Hello". This is also documented in the Java API doc: "Returns a new string that is a …

  2. java - how the subString () function of string class works - Stack Overflow

    “Substring creates a new object out of source string by taking a portion of original string”. Until Java 1.7, substring holds the reference of the original character array, which means even a sub-string of 5 …

  3. The String.substring() in java - Stack Overflow

    Dec 24, 2016 · string.substring(int id) returns a substring of the string which starts at index id. id is an index, but not the position! Remember, indexes start counting from 0! Please, check the Javadoc. …

  4. java - substring index range - Stack Overflow

    To make life easier for substring operation, imagine that characters are between indexes. 0 1 2 3 4 5 6 7 8 9 10 <- available indexes for substring u n i v E R S i t y ↑ ↑ start end --> range of "E R S" Quoting …

  5. Java: Getting a substring from a string starting after a particular ...

    Java: Getting a substring from a string starting after a particular character Asked 13 years, 1 month ago Modified 1 year, 9 months ago Viewed 637k times

  6. Función substring() dentro de Java - Stack Overflow en español

    Jul 7, 2021 · La función substring () en Java devuelve una cadena de caracteres y puede recibir uno o dos parámetros. El primer parámetro indica la posición inicial y el segundo la posición final a partir …

  7. In Java, how do I check if a string contains a substring (ignoring case ...

    In Java, how do I check if a string contains a substring (ignoring case)? [duplicate] Asked 16 years ago Modified 4 years, 2 months ago Viewed 1.3m times

  8. Java - Strings and the substring method - Stack Overflow

    Apr 19, 2013 · Strings in Java are immutable. Basically this means that, once you create a string object, you won't be able to modify/change the content of a string. As a result, if you perform any …

  9. Get Substring from a String in Java - Stack Overflow

    May 17, 2017 · Get Substring from a String in Java Asked 8 years, 9 months ago Modified 8 years, 9 months ago Viewed 13k times

  10. Java substring: 'String index out of range' - Stack Overflow

    Jun 5, 2009 · Java's substring method fails when you try and get a substring starting at an index which is longer than the string. An easy alternative is to use StringUtils.substring: