Trim - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


StringTools

  

TrimLeft

  

trim leading whitespace from a string

  

TrimRight

  

trim trailing whitespace from a string

  

Trim

  

trim leading and trailing whitespace from a string

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

TrimLeft( s )

TrimRight( s )

Trim( s )

Parameters

s

-

Maple string

Description

• 

The TrimLeft(s) command removes the leading whitespace from string s and returns the resulting terminal substring. If string s has no leading whitespace, then it is returned unchanged.

• 

The TrimRight(s) command removes the trailing whitespace from string s and returns the resulting substring. If string s has no trailing whitespace, then it is returned unchanged.

  

The TrimRight function is defined by TrimRights=ReverseTrimLeftReverses.

• 

The Trim(s) command is defined to be the composition TrimRight@TrimLeft.

• 

All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

Examples

withStringTools:

s \t This is a test. \n

s This is a test.

(1)

TrimLefts

This is a test.

(2)

TrimRights

This is a test.

(3)

Trims

This is a test.

(4)

See Also

@

string

StringTools

StringTools[IsSpace]

StringTools[Reverse]