In the above program, the RegEx is used with the replace() method to trim the string. /^\s+|\s+$/g checks for whitespace at the beginning and end of the string.
確定! 回上一頁