Name

trim — Remove whitespace from the beginning and end of a string

Usage

String.trim(str)

str : String

Description

Returns a new string in which any leading or trailing whitespace in str has been removed. Returns invalid if str can’t be converted to a string.

Examples

String.trim("foo")

returns "foo"

String.trim(" Once upon a time ")

returns string "Once upon a time"

String.trim(invalid)

returns invalid

Get Learning WML, and WMLScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.