About 122,000 results
Open links in new tab
  1. Difference between String trim() and strip() methods

    The methods that only accept a char value cannot support supplementary characters. ... The methods that accept an int value support all Unicode characters, including supplementary characters. …

  2. How do I compare strings in Java? - Stack Overflow

    Apr 2, 2013 · Other Methods To Consider String.equalsIgnoreCase () value equality that ignores case. Beware, however, that this method can have unexpected results in various locale-related cases, see …

  3. Sort a single String in Java - Stack Overflow

    Is there a native way to sort a String by its contents in java? E.g. String s = "edcba" -> "abcde"

  4. java - Difference between String replace () and replaceAll () - Stack ...

    May 31, 2012 · What's the difference between java.lang.String 's replace() and replaceAll() methods, other than the latter uses regex? For simple substitutions like, replace . with /, is there any difference?

  5. How to use the toString method in Java? - Stack Overflow

    Sep 1, 2010 · Can anybody explain to me the concept of the toString() method, defined in the Object class? How is it used, and what is its purpose?

  6. Remove part of string in Java - Stack Overflow

    There are multiple ways to do it. If you have the string which you want to replace you can use the replace or replaceAll methods of the String class. If you are looking to replace a substring you can …

  7. java - Reverse a string without using string functions - Stack Overflow

    Aug 2, 2016 · Closed 11 years ago. How to write a java program to reverse a string without using string functions?

  8. java - Why can we use String without an import - Stack Overflow

    Oct 31, 2011 · When we use ArrayList or HashMap in Java, we have to import java.util.ArrayList or java.util.HashMap. But when we use String, it doesn't require the import statement. Can anyone …

  9. java - How do I count the number of occurrences of a char in a String ...

    The loop method is much faster than this. Especially when wanting to count a char instead of a String (since there is no String.replace (char, char) method). On a 15 character string, I get a difference of …

  10. java - Simple way to repeat a string - Stack Overflow

    I'm looking for a simple commons method or operator that allows me to repeat some string n times. I know I could write this using a for loop, but I wish to avoid for loops whenever necessary and a ...