About 50 results
Open links in new tab
  1. java - Difference between String trim () and strip () methods - Stack ...

    The String.strip (), String.stripLeading (), and String.stripTrailing () methods trim white space [as determined by Character.isWhiteSpace ()] off either the front, back, or both front and back of the …

  2. java - How to trim the whitespace from a string? - Stack Overflow

    The simple way to trim leading and trailing whitespace is to call String.trim(). With Java 11 and later, you can also use String.strip() which uses a different interpretation of what "white space" means 1. If you …

  3. Strip Leading and Trailing Spaces From Java String

    Jul 11, 2011 · With Java-11 and above, you can make use of the String.strip API to return a string whose value is this string, with all leading and trailing whitespace removed.

  4. java - Trim leading or trailing characters from a string ... - Stack ...

    Oct 8, 2021 · How can I trim the leading or trailing characters from a string in java? For example, the slash character "/" - I'm not interested in spaces, and am looking to trim either leading or trailing …

  5. java - How to remove newlines from beginning and end of a string ...

    Sep 17, 2011 · String::strip… The old String::trim method has a strange definition of whitespace. As discussed here, Java 11 adds new strip… methods to the String class. These use a more Unicode …

  6. java - How to remove leading zeros from alphanumeric text ... - Stack ...

    May 10, 2010 · I've seen questions on how to prefix zeros here in SO. But not the other way! Can you guys suggest me how to remove the leading zeros in alphanumeric text? Are there any built-in APIs …

  7. java - Easy way to remove accents from a Unicode string ... - Stack ...

    5 Assuming you are using Java 6 or newer, you might want to take a look at Normalizer, which can decompose accents, then use a regex to strip the combining accents. Otherwise, you should be able …

  8. java - How can I trim beginning and ending double quotes from a …

    18 This is the best way I found, to strip double quotes from the beginning and end of a string.

  9. string - Trim characters in Java - Stack Overflow

    Trim characters in Java Asked 16 years, 1 month ago Modified 5 years, 4 months ago Viewed 175k times

  10. java - Remove HTML tags from a String - Stack Overflow

    Oct 27, 2008 · The problem with trying to strip html is that browsers have very lenient parsers, more lenient than any library you can find will, so even if you do your best to strip all tags (using the …