See CR 4080617. In addition, see the blog entry, http://closingbraces.net/2008/11/11/javastringtrim/
In short, trim() has very limited capabilities and strips off far more (or less) than is desirable. To quote the blogger, Mike Kaufman --
"The String.trim() method talks about “whitespace”, but defines this in a very precise but rather crude and idiosyncratic way – it simply regards anything up to and including U+0020 (the usual space character) as whitespace, and anything above that as non-whitespace.
This results in it trimming the U+0020 space character and all “control code” characters below U+0020 (including the U+0009 tab character), but not the control codes or Unicode space characters that are above that."
This RFE is to implement one (or more) additional "trim" methods that are smarter about what is trimmed. In addition to what is suggested by Mr. Kaufman, we might consider a user-definable trim-set of characters.
In short, trim() has very limited capabilities and strips off far more (or less) than is desirable. To quote the blogger, Mike Kaufman --
"The String.trim() method talks about “whitespace”, but defines this in a very precise but rather crude and idiosyncratic way – it simply regards anything up to and including U+0020 (the usual space character) as whitespace, and anything above that as non-whitespace.
This results in it trimming the U+0020 space character and all “control code” characters below U+0020 (including the U+0009 tab character), but not the control codes or Unicode space characters that are above that."
This RFE is to implement one (or more) additional "trim" methods that are smarter about what is trimmed. In addition to what is suggested by Mr. Kaufman, we might consider a user-definable trim-set of characters.
- relates to
-
JDK-4080617 API: String.trim() method not working for all Unicode characters with SPACE prop
-
- Closed
-