Skip to content

global plugin_template._core.texter


methods


M.is_alphanumeric


function M.is_alphanumeric(character: string) ->  boolean

@param character - Some single-value to check.

@return - If it's alpha return true.

Check if character is a standard A-Z 0-9ish character.

M.is_unicode


function M.is_unicode(character: string) ->  boolean

@param character - Some single-value to check.

@return - If found return true.

Check if character is "regular" text but not alphanumeric.

Examples would be Asian characters, Arabic, emojis, etc.

M.is_string_list


function M.is_string_list(items: any) ->  boolean

@param items - An array to check.

@return - If found, return true.

Check if items is a flat array/list of string values.

M.is_whitespace


function M.is_whitespace(character: string) ->  boolean

@param character - Basically " ", \n, \t.

@return - If it's any whitespace, return true.

Check if character is a space, tab, or newline.

M.get_array_startswith


function M.get_array_startswith(
  values: string[],
  prefix: string
) ->  string[]

@param values - All values to check. e.g. {"foo", "bar"}.

@param prefix - The prefix text to search for.

@return - All found values, if any.

Check all elements in values for prefix text.

M.indent


function M.indent(text: string) ->  string

@param text - Some phrase to indent one level. e.g. "foo".

@return - The indented text, " foo".

Add indentation to `text.

M.lstrip


function M.lstrip(text: string) ->  string

@param text - Some text e.g. " -- ".

@return - The removed text e.g. "-- ".

Remove leading (left) whitespace text, if there is any.

M.startswith


function M.startswith(
  text: string,
  start: string
) ->  boolean

@param text - The full character / word / phrase. e.g. "foot".

@param start - The first letter(s) to check for. e.g.g "foo".

@return - If found, return true.

Check if text starts with start string.