About 4,710,000 results
Open links in new tab
  1. java - substring index range - Stack Overflow

    14 Both are 0-based, but the start is inclusive and the end is exclusive. This ensures the resulting string is of length start - end. To make life easier for substring operation, imagine that …

  2. 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 …

  3. 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 …

  4. java - how the subString () function of string class works - Stack …

    0 “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 …

  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 12 years, 10 months ago Modified 1 year, 6 months ago Viewed 637k times

  6. Java - removing first character of a string - Stack Overflow

    Dec 22, 2010 · In Java, I have a String: Jamaica I would like to remove the first character of the string and then return amaica How would I do this?

  7. How to remove the last character from a string? - Stack Overflow

    Sep 16, 2011 · If one simply applies the currently accepted answer (using str.substring(0, str.length() - 1), one splices the surrogate pair, leading to unexpected results. One should also …

  8. Extraer caracteres con metodo substring en java

    Extraer caracteres con metodo substring en java Formulada hace 7 años y 2 meses Modificada hace 5 años y 9 meses Vista 4k veces

  9. In Java, how do I check if a string contains a substring (ignoring …

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

  10. How to get the last characters in a String in Java, regardless of ...

    Jul 14, 2010 · String numbers = text.substring(text.length() - 7, text.length()); But be sure to catch Exception if the input string length is less than 7. You can replace 7 with any number say N, if …