Module classes.helpers.vString

Static string-manipulation methods for the vString library

Functions

strip_leading_trailing_chars (str, chr, rlead, rtrail) Strip leading and/or trailing character from string
strip_line (str, patt) Strip line matching pattern, from multiline string
string_to_percentage (str)
get_sortable_time (tstamp) sortable time - date which can be sorted alphabetically
table_to_string (t, args) present a lua table as a formatted string


Functions

strip_leading_trailing_chars (str, chr, rlead, rtrail)
Strip leading and/or trailing character from string

Parameters:

  • str (string) the string to search
  • chr (string) the character to match, e.g. "\n" or " "
  • rlead (bool) remove leading
  • rtrail (bool) remove trailing

Returns:

    str
strip_line (str, patt)
Strip line matching pattern, from multiline string

Parameters:

  • str (string)
  • patt (string)

Returns:

  1. str, resulting string
  2. int, #stripped lines
string_to_percentage (str)

Parameters:

  • str (string), e.g. "33.3%"
get_sortable_time (tstamp)
sortable time - date which can be sorted alphabetically

Parameters:

  • tstamp [[

Returns:

    string
table_to_string (t, args)
present a lua table as a formatted string

Parameters:

  • t (table)
  • args (table) formatting directives multiline: if false, create single-line string number_format: formatting for numeric values (e.g. precision)

Returns:

    string
generated by LDoc 1.4.2