how to trim spaces from end of string java code example
Example: remove spaces at beginning and end of string java
String withSpaces = " Hi ";
String withoutSpaces = withSpaces.trim();
String withSpaces = " Hi ";
String withoutSpaces = withSpaces.trim();