string.len

From Garry's Mod
Jump to: navigation, search
 string.len( )

Contents

Description

Counts the number of characters in the string (length). This is equivalent to using the length operator (#).

Arguments

string str

The string to find the length of.

Returns

number

Length of the string

Examples

Example

Demonstrates the use of this function.

print( string.len( "hi" ) )
print( string.len( "drakehawke" ) )
print( string.len( "" ) )
print( string.len( "test" ) == #"test" )

Output:


2
10
0
true
Personal tools
Navigation