Command Reference : Function Reference : Function Reference: S
  
 
@strlen
Length of string.
Syntax: @strlen(str)
str: string
Return: integer
Returns the length of the string str.
Examples
Let
string s1 = "(I don’t know)"
so that S1 contains the string “(I don’t know)”.
Then the commands
@strlen("(I don’t know)")
@strlen(s1)
both return the scalar value 14.
If ALPHA1 is an alpha series, the command
series d1 = @strlen(alpha1)
fills D1 with lengths of the strings in ALPHA1 for each observation in the workfile sample.
If AVEC1 is an svector, the commands
vector vec1 = @strlen(avec1)
creates the vector VEC1 containing the lengths of the elements of AVEC1.
Cross-references
Equivalent to @length.