StringTools - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Names and Strings : StringTools Package : WhiteSpace Utilities : StringTools/Chop

StringTools

 Chop
 remove the last character of a string

 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.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Chop}\left("abc"\right)$
 ${"ab"}$ (1)
 > $\mathrm{Chop}\left("This is a test."\right)$
 ${"This is a test."}$ (2)
 > $\mathrm{Chop}\left(""\right)$
 ${""}$ (3)

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam