Module sv_string

String utilities

Functions

Split (inputstr, sep) Split function.
Capitalise (str) Capitalise function.
Compare (str1, str2) Compare function.
StartsWith (str, start) Starts With function.
GenerateLettersAndNumbers (length) GenerateLettersAndNumbers function.


Functions

Split (inputstr, sep)
Split function. This function splits a string into a table.

Parameters:

  • inputstr The string to split.
  • sep The separator.

Returns:

    table

Usage:

    local tbl = exports.jones_util:Split("Hello World", " ")
Capitalise (str)
Capitalise function. This function capitalises the first letter of a string.

Parameters:

  • str The string to capitalise.

Returns:

    string

Usage:

    local str = exports.jones_util:Capitalise("hello world")
Compare (str1, str2)
Compare function. This function compares two strings.

Parameters:

  • str1 The first string.
  • str2 The second string.

Returns:

    boolean

Usage:

    local bool = exports.jones_util:Compare("hello world", "HELLO WORLD")
StartsWith (str, start)
Starts With function. This function checks if a string starts with another string.

Parameters:

  • str The string to check.
  • start The string to check against.

Returns:

    boolean

Usage:

    local bool = exports.jones_util:StartsWith("hello world", "hello")
GenerateLettersAndNumbers (length)
GenerateLettersAndNumbers function. This function generates a random string of letters and numbers.

Parameters:

  • length The string's length.

Returns:

    string

Usage:

    local str = exports.jones_util:GenerateLettersAndNumbers(7)
generated by LDoc 1.5.0 Last updated 2024-05-13 19:05:24