utf8.codepoint

From Garry's Mod
Jump to: navigation, search
 utf8.codepoint( )

Contents

Description

Returns the codepoints (as numbers) from all characters in the given string that start between byte position startPos and endPos. It raises an error if it meets any invalid byte sequence. This functions similarly to string.byte.

Arguments

string string

The string that you will get the code(s) from.

Arguments

number startPos=1

The starting byte of the string to get the codepoint of.

Arguments

number endPos=1

The ending byte of the string to get the codepoint of.

Returns

vararg

The codepoint number(s).

Examples

Example

Demonstrates usage of the function.

print( utf8.codepoint( "Мёнём", 1, -1 ) )

Output:

1052 1105 1085 1105 1084
Personal tools
Navigation