Siebel VB Language Reference > Methods Reference for Siebel VB > String Methods >
Get String Length Method
The Get String Length method gets the length of one of the following:
- The string that the string argument contains
- The string in the variable that the varName argument identifies
Format A
Len(string)
Format B
Len(varName)
Arguments
The following table describes the arguments that you can use with this method.
|
|
string |
Includes a string or an expression that evaluates to a string. If you use the string argument, then this method returns the number of characters that the string contains.
|
varName |
Identifies a variable that contains a string. If the varName argument:
- Identifies a variant variable. This method returns as a string the number of bytes required to identify the value of this variable.
- Identifies a variant variable that contains NULL. This method returns a Null variant.
- Does not identify a variant variable. This method returns the length of the predefined data type or the custom type.
|
Example
The following example returns the length of a name that the user enters, including spaces: Sub Button_Click Dim username as String username = "Chris Smith" count = Len(username) End Sub
|