O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required