UtfLen: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
addCommandHandler( 'russian_text_length', | addCommandHandler( 'russian_text_length', | ||
function( ) | function( ) | ||
outputChatBox( string.format( 'Russian text length is % | outputChatBox( string.format( 'Russian text length is: %d', utfLen( 'Текст' ) ) ) | ||
end | end | ||
) | ) |
Revision as of 11:26, 13 June 2012
The function gets the real length of a string, in characters.
Syntax
int utfLen ( string theString )
Required Arguments
- theString: The string to get the length of.
Returns
Returns an int if the function was successful, false otherwise.
Example
Click to collapse [-]
ClientThis example adds a command russian_text_length which prints out a length russian text.
addCommandHandler( 'russian_text_length', function( ) outputChatBox( string.format( 'Russian text length is: %d', utfLen( 'Текст' ) ) ) end )
See Also
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub