Equinox Online Help - Language Reference - A to Z

Home

Len

Applies to
SyntaxLen(StringExpression)
Action[Function] Returns the number of characters in a string.
ScopeUsable anywhere.
Notes

This function returns the number of characters in StringExpression.

The Equinox method language ignores trailing spaces in string fields and workareas. Hence, the length of a field full of space characters is returned as zero. This is because string fields and workareas are fixed length items, but variables have a defined length which may be less than their maximum length. The language converts dictionary items to variable length by removing trailing spaces. Memo fields are not fixed length so trialing spares are included.

CategoryString handling
See Also ChrList, Chrs, Compare, Fill, IsNumber, Left_Function, Match, Maxlen, Mid_Function, Remove, Replace, Right_Function], Search_SearchNext, SetLen, SetMaxLen, SortOrder, SubstituteData
Example

This example determines how many times the number 1 appears in the account number accno.

number NumOnes

NumOnes = 0

for i = 1 to Len(accno)
if accno[i] = "1" then NumOnes += 1
next