13 February 2012

Java normalize spaces

How work with XSLT should know about "normalize spaces" see : XPath normalize-space() doesn't just trim!

To accomplish this in Java, use:
"My      non-normalized spaces   string   ".replaceAll("\\s+", " ")

Source: http://stackoverflow.com/questions/5472450/how-to-normalize-polish-a-text-in-java#5472516

No comments: