WMLScript squeeze() Function

The squeeze() function compresses all consecutive whitespace in the string into a single space.

Syntax

n = String.squeeze(string)
Component Description
n The string returned from the function.
string A string.

Example

var a = String.squeeze("Visit   CodeW3C.com!\r\n");

Result

a = "Visit CodeW3C.com "