trimWhitespace function

String trimWhitespace(
  1. String param
)

trim white space Removes white spaces in between a string, at the beginning and at the end

Implementation

String trimWhitespace(String param) {
  return param.toString().trim().split(' ').join();
}