URLify a given string ( Replace spaces is % 20 ) | Instantiate the string ; Trim the given string ; Replace All space ( unicode is \\ s ) to % 20 ; Display the result
var str = " " ; str = str . trim ( ) ; str = str . replaceAll ( " " , " " ) ; document . write ( str ) ;