Elektrine lite

← Feed

@cayhorstmann@foojay.social

Post #2128656

2026-05-03 19:26 UTC

PSA about white space in modern Java. Character::isWhitespace and String::strip are aligned. Stay away from legacy Character::isSpace and String::trim. But the regex "(?U)\\s" differs in eight code points: 28, 29, 30, 31, (Information separator 4...1) pass isWhiteSpace and not \s. Conversely, 133 (Next line), 160 (No-break space ⚠), 8199 (Figure space), 8239 (Narrow no-break space) don't pass isWhiteSpace but match \s.

Replies (0)

No replies.