Garry's Mod Wiki

Garry's Mod Wiki

  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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...