how to trim space in string javacript code example Example: javascript trim spaces value = value.trim();