StringLength

StringLength["string"]

gives the number of characters in a string.

Details

  • StringLength counts special characters such as as single characters, even if their full names involve many characters.
  • StringLength[{s1,s2,}] gives the list of lengths of each of the si.

Examples

open allclose all

Basic Examples  (1)

Find the number of characters in a string:

In[1]:=
Click for copyable input
Out[1]=

Scope  (3)

Applications  (1)

Properties & Relations  (1)

Possible Issues  (2)

See Also

Length  Characters

Tutorials

Introduced in 1988
(1.0)
| Updated in 2004
(5.1)