Chop - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


StringTools

  

Chop

  

remove the last character of a string

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Chop( s )

Parameters

s

-

Maple string

Description

• 

The Chop(s) command returns a copy of input string s with the last character removed, if the string is nonempty. As a special case, the empty string is returned unchanged.

  

Note: This function is similar to the Perl function of the same name.

• 

Compare this procedure with the other perl-esque routine StringTools[Chomp], which removes only line ending characters.

• 

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:

Chopabc

ab

(1)

ChopThis is a test.\n

This is a test.

(2)

Chop

(3)

See Also

string

StringTools

StringTools[Chomp]

StringTools[Trim]