Garry's Mod Wiki

string.len

number string.len( string str )

Description

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

Arguments

1 string str
The string to find the length of.

Returns

1 number
Length of the string

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

Page Links


Special Pages


Wikis

?

Render Time: 29ms

DB GetPage 4
Generate Html 3
SaveChanges (1) 8
Render Body 0
Render Sidebar 11