5

Questions like this discuss the limitations to the logic used by the String::trim method. Some libraries such as Guava offer alternatives.

I vaguely recall that a recent version of Java (8, 9, 10) shipped with an alternative, a more modern Unicode-savvy approach to defining and removing whitespace characters from text.

Is there such a facility bundled with Java now?

Lenin Raj Rajasekaran
  • 21,611
  • 14
  • 96
  • 136
Basil Bourque
  • 262,936
  • 84
  • 758
  • 1,028

0 Answers0