Official Content

Returns the number of characters in a character expression.

Syntax

String.Length()

Where:

String
    Is an attribute or variable based on the Character/VarChar/LongVarChar data type.

Type Returned:
Numeric

Scope

Data Types: CharacterVarCharLongVarChar
Generators: .NET, .NET Framework, Java,  RPG, Cobol, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

Description

The Length method returns the number of characters in a character expression. 

Samples

&Text = "Length method test"
&Nbr = &Text.Length()        //&Nbr value is: 18
&Text = " Length method test " 
&Nbr = &Text.Length()        //&Nbr value is: 20
&Nbr = CustomerName.Length() //&Nbr value will be the number of characters corresponding to the CustomerName attribute content. 

See Also

Len function

   


Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant