To return the number of characters in a character expression.
Len(Character-Expression)
Type Returned:
Numeric
Where:
Character-Expression
Must be a Character Expression.
The LEN function returns the number of characters in a character expression. Trailing blanks are ignored.
We define the following variables:
Variable Type
&CExp C(20)
&Length N(1)
Source:
&CExp = 'HELLO'
&Length = Len(&CExp)
&Msg = concat('LEN returns', Str(&Length,1), '')
&CExp = ' HELLO ' //(trailing blanks will be ignored)
&Length = Len(&CExp)
&Msg = Concat('LEN returns', Str(&Length,1), '')
The result is: 'LEN returns 5' and 'LEN returns 6'
Objects: Procedures, Transactions, Web Panels, Work Panels
Languages: .NET, Ruby (up to GeneXus X Evolution 3), Java, RPG, Visual FoxPro (up to GeneXus X Evolution 3), Cobol
Length Method
|