WMLScript squeeze() function

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

Syntax

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

Example

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

Result

a = "Visit CodeW3C.com "