30.6 LengthString

LengthString( string )

LengthString returns the length of the string string. The length of a string is the number of characters in the string. Escape sequences (see Strings and Characters) are just a two character representation for a single character, and are thus counted as single character by LengthString.

    gap> LengthString( "" );
    0
    gap> LengthString( "Hello" );
    5
    gap> LengthString( "Hello world.\n" );
    13 

Because strings are now lists, Length (see Length) does exactly the right thing, and the function LengthString is obsolete.

Previous Up Top
Index

GAP 3.4.4
April 1997