Documentation
¶
Index ¶
- func BytesToRune(L *lua.LState) int
- func BytesToString(L *lua.LState) int
- func ContainsRune(L *lua.LState) int
- func IsControl(L *lua.LState) int
- func IsDigit(L *lua.LState) int
- func IsGraphic(L *lua.LState) int
- func IsInRange(L *lua.LState) int
- func IsLetter(L *lua.LState) int
- func IsLower(L *lua.LState) int
- func IsMark(L *lua.LState) int
- func IsNumber(L *lua.LState) int
- func IsPrint(L *lua.LState) int
- func IsPunct(L *lua.LState) int
- func IsSpace(L *lua.LState) int
- func IsSymbol(L *lua.LState) int
- func IsTitle(L *lua.LState) int
- func IsUpper(L *lua.LState) int
- func IsValidUTF8(L *lua.LState) int
- func Loader(L *lua.LState) int
- func Preload(L *lua.LState)
- func ReverseRunes(L *lua.LState) int
- func RuneAt(L *lua.LState) int
- func RuneCount(L *lua.LState) int
- func RuneIndex(L *lua.LState) int
- func RuneRange(L *lua.LState) int
- func RuneSlice(L *lua.LState) int
- func RuneSplit(L *lua.LState) int
- func RuneString(L *lua.LState) int
- func RuneToBytes(L *lua.LState) int
- func RuneWidth(L *lua.LState) int
- func StringToBytes(L *lua.LState) int
- func ToLower(L *lua.LState) int
- func ToTitle(L *lua.LState) int
- func ToUpper(L *lua.LState) int
- func ValidRune(L *lua.LState) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToRune ¶
BytesToRune converts UTF-8 bytes to a rune. Takes a table of bytes and returns the corresponding rune value as a lua.LNumber, or nil if the bytes are not valid UTF-8.
func BytesToString ¶
BytesToString converts UTF-8 bytes to a string. Takes a table of bytes and returns the corresponding string as a lua.LString.
func ContainsRune ¶
ContainsRune checks if a rune exists in a string. Parameters:
- string: The input string to search
- rune: The rune to search for
Returns a boolean as lua.LBool indicating whether the rune exists in the string.
func IsControl ¶
IsControl checks if a rune is a Unicode control character. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsDigit ¶
IsDigit checks if a rune is a Unicode decimal digit. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsGraphic ¶
IsGraphic checks if a rune is graphic. Takes a rune value as an integer and returns a boolean as lua.LBool. Graphic characters include letters, marks, numbers, punctuation, symbols, but not spaces or control characters.
func IsInRange ¶
IsInRange checks if a rune is within a specified range. Parameters:
- rune: The rune to check
- lo: The lower bound of the range (inclusive)
- hi: The upper bound of the range (inclusive)
Returns a boolean as lua.LBool indicating whether the rune is within the range.
func IsLetter ¶
IsLetter checks if a rune is a Unicode letter. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsLower ¶
IsLower checks if a rune is a lowercase letter. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsMark ¶
IsMark checks if a rune is a Unicode mark character. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsNumber ¶
IsNumber checks if a rune is a Unicode number (includes characters besides 0-9). Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsPrint ¶
IsPrint checks if a rune is printable. Takes a rune value as an integer and returns a boolean as lua.LBool. Printable characters include letters, marks, numbers, punctuation, symbols, and spaces, but not control characters.
func IsPunct ¶
IsPunct checks if a rune is a Unicode punctuation character. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsSpace ¶
IsSpace checks if a rune is a Unicode white space character. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsSymbol ¶
IsSymbol checks if a rune is a Unicode symbol character. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsTitle ¶
IsTitle checks if a rune is a Unicode title case letter. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsUpper ¶
IsUpper checks if a rune is an uppercase letter. Takes a rune value as an integer and returns a boolean as lua.LBool.
func IsValidUTF8 ¶
IsValidUTF8 checks if a string contains valid UTF-8 encoding. Takes a string argument and returns a boolean indicating whether the string is valid UTF-8 as a lua.LBool.
func Loader ¶
Loader is the module loader function for the runes package. It creates a new table and populates it with the package's functions.
func Preload ¶
Preload registers the runes package loader function. It should be called during Lua state initialization to make the package available.
func ReverseRunes ¶
ReverseRunes reverses the runes in a string. Takes a string argument and returns a new string with the runes in reverse order as a lua.LString.
func RuneAt ¶
RuneAt returns the rune at a specific byte position in a string. Parameters:
- string: The input string
- position: The 1-based index of the desired rune
Returns nil if the position is invalid or the rune is not valid UTF-8, otherwise returns the rune value as a lua.LNumber.
func RuneCount ¶
RuneCount returns the number of runes in a string. Takes a string argument and returns the count of Unicode code points in that string as a lua.LNumber.
func RuneIndex ¶
RuneIndex finds the first occurrence of a rune in a string. Parameters:
- string: The input string to search
- rune: The rune to search for
- start: Optional 1-based starting position (defaults to 1)
Returns the 1-based index of the first occurrence as lua.LNumber, or nil if the rune is not found.
func RuneRange ¶
RuneRange extracts a substring by rune indices. Parameters:
- string: The input string
- start: Optional 1-based start index (defaults to 1)
- end: Optional 1-based end index (defaults to -1, meaning end of string)
Returns the substring as lua.LString.
func RuneSlice ¶
RuneSlice converts a string to a slice of rune values. Takes a string argument and returns a Lua table containing the numeric values of each rune in the string.
func RuneSplit ¶
RuneSplit splits a string on a specified rune delimiter. Parameters:
- string: The input string to split
- separator: The rune to use as the delimiter
Returns a Lua table containing the resulting substrings.
func RuneString ¶
RuneString converts a slice of integers to a string of runes. Each integer argument is converted to a rune and concatenated into a string. Returns the resulting string as a lua.LString.
func RuneToBytes ¶
RuneToBytes converts a table of runes to their UTF-8 byte representation. Takes a table of rune values as integers and returns a Lua table containing the UTF-8 bytes of all runes concatenated together.
func RuneWidth ¶
RuneWidth returns the number of bytes needed to encode a rune. Takes a rune value as an integer and returns its UTF-8 encoding width as a lua.LNumber, or nil if the rune is invalid.
func StringToBytes ¶
StringToBytes converts a string to its UTF-8 byte representation. Takes a string and returns a Lua table containing the UTF-8 bytes.
func ToLower ¶
ToLower converts a rune to lowercase. Takes a rune value as an integer and returns the lowercase version as lua.LNumber.
func ToTitle ¶
ToTitle converts a rune to title case. Takes a rune value as an integer and returns the title case version as lua.LNumber.
Types ¶
This section is empty.