SyntaxFix
Write A Post
Hire A Developer
Questions
In Java:
String str = " hello world "; // prints "hello world" System.out.println(str.replaceAll("^(\\s+)|(\\s+)$", ""));