About 84,300 results
Open links in new tab
  1. 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

  2. Get the last three chars from any string - Java - Stack Overflow

    I'm trying to take the last three chracters of any string and save it as another String variable. I'm having some tough time with my thought process. String word = "onetwotwoone" int length = …

  3. java - Limiting the number of characters in a string, and chopping …

    I don't know which method does this or if a string can be instantiated to behave taht way. Using the formatter only helps with the fixed-with formatting for printing the string, but it does not …

  4. How to get a string between two characters? - Stack Overflow

    20 Java supports Regular Expressions, but they're kind of cumbersome if you actually want to use them to extract matches. I think the easiest way to get at the string you want in your example …

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

  6. java - How to insert a character in a string at a certain position ...

    I'm getting in an int with a 6 digit value. I want to display it as a String with a decimal point (.) at 2 digits from the end of int. I wanted to use a float but was suggested to use String for a ...

  7. How to capitalize the first letter of word in a string using Java?

    Example strings one thousand only two hundred twenty seven How do I change the first character of a string in capital letter and not change the case of any of the other letters? After the change it

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

    12 You can use Apache commons: For substring after last occurrence use this method. And for substring after first occurrence equivalent method is here.

  9. java - how to find before and after sub-string in a string - Stack …

    I need to find them and hold them in separate string variables, say String firstSubString = 123; and String secondSubString = 456;. Is there any given String method that does just that?

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

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