Length - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


StringTools

  

Length

  

return the length of a string

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Length( s )

Parameters

s

-

string; the string whose length is to be computed

Description

• 

The Length command computes the length of the string s. This is the same value as is returned by the global length command, but it accepts only strings.

• 

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

> 

with⁡StringTools:

> 

Length⁡

0

(1)
> 

Length⁡abcde

5

(2)
> 

length⁡abcde

5

(3)
> 

Length⁡aqueosalinocalcalinoetaceoaluminiumosecupreovitriolic

53

(4)
> 

Length⁡x2

Error, invalid input: StringTools:-Length expects its 1st argument, s, to be of type string, but received x^2

> 

length⁡x2

5

(5)

Notice that, like length, the Length command counts the number of bytes in the string, not the number of characters.

> 

Length⁡d303251cembre

9

(6)

See Also

length

StringTools

with