mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
remove zero width no-break space (U+FEFF) character with trim()
This commit is contained in:
@@ -8943,7 +8943,8 @@ public class PApplet implements PConstants {
|
||||
*
|
||||
* Removes whitespace characters from the beginning and end of a String. In
|
||||
* addition to standard whitespace characters such as space, carriage
|
||||
* return, and tab, this function also removes the Unicode "nbsp" character.
|
||||
* return, and tab, this function also removes the Unicode "nbsp" (U+00A0)
|
||||
* character and the zero width no-break space (U+FEFF) character.
|
||||
*
|
||||
* @webref data:string_functions
|
||||
* @webBrief Removes whitespace characters from the beginning and end of a String.
|
||||
@@ -8955,7 +8956,8 @@ public class PApplet implements PConstants {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
return str.replace('\u00A0', ' ').trim();
|
||||
// remove nbsp *and* zero width no-break space
|
||||
return str.replace('\u00A0', ' ').replace('\uFEFF', ' ').trim();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
1272 (4.0a3)
|
||||
X loadJSONObject/Array() now return null if the given file was not found
|
||||
X https://github.com/processing/processing/pull/6081
|
||||
X remove zero width no-break space (U+FEFF) character with trim()
|
||||
|
||||
|
||||
fixed in 4.x (close/lock these with final 4.0 release)
|
||||
|
||||
Reference in New Issue
Block a user