GitHub

This package contains some useful string and character functions. Each function supports positive and negative offsets — i.e., offset from the end of the string. For example:

plvstr.left('abcdef',2) -> ab
plvstr.left('abcdef',-2) -> abcd
plvstr.substr('abcdef',1,1) -> a
plvstr.substr('abcdef',-1,1) -> f
plvstr.substr('abcde',-2,1) -> d
  • plvstr.normalize(str text) - Normalize string - Replace white chars by space, replace spaces by space

  • plvstr.is_prefix(str text, prefix text, cs bool) - Returns true, if prefix is prefix of str

  • plvstr.is_prefix(str text, prefix text) - Returns true, if prefix is prefix of str

  • plvstr.is_prefix(str int, prefix int) - Returns true, if prefix is prefix of str

  • plvstr.is_prefix(str bigint, prefix bigint) - Returns true, if prefix is prefix of str

  • plvstr.substr(str text, start int, len int) - Returns substring started on start_in to end

  • plvstr.substr(str text, start int) - Returns substring started on start_in to end

  • plvstr.instr(str text, patt text, start int, nth int) - Search pattern in string

  • plvstr.instr(str text, patt text, start int) - Search pattern in string

  • plvstr.instr(str text, patt text) - Search pattern in string

  • plvstr.lpart(str text, div text, start int, nth int, all_if_notfound bool) - Call this function to return the left part of a string

  • plvstr.lpart(str text, div text, start int, nth int) - Call this function to return the left part of a string

  • plvstr.lpart(str text, div text, start int) - Call this function to return the left part of a string

  • plvstr.lpart(str text, div text) - Call this function to return the left part of a string

  • plvstr.rpart(str text, div text, start int, nth int, all_if_notfound bool) - Call this function to return the right part of a string

  • plvstr.rpart(str text, div text, start int, nth int) - Call this function to return the right part of a string

  • plvstr.rpart(str text, div text, start int) - Call this function to return the right part of a string

  • plvstr.rpart(str text, div text) - Call this function to return the right part of a string

  • plvstr.lstrip(str text, substr text, num int) - Call this function to remove characters from the beginning

  • plvstr.lstrip(str text, substr text) - Call this function to remove characters from the beginning

  • plvstr.rstrip(str text, substr text, num int) - Call this function to remove characters from the end

  • plvstr.rstrip(str text, substr text) - Call this function to remove characters from the end

  • plvstr.rvrs(str text, start int, _end int) - Reverse string or part of string

  • plvstr.rvrs(str text, start int) - Reverse string or part of string

  • plvstr.rvrs(str text) - Reverse string or part of string

  • plvstr.left(str text, n int) - Returns firs num_in characters. You can use negative num_in

  • plvstr.right(str text, n int) - Returns last num_in characters. You can use negative num_ni

  • plvstr.swap(str text, replace text, start int, length int) - Replace a substring in a string with a specified string

  • plvstr.swap(str text, replace text) - Replace a substring in a string with a specified string

  • plvstr.betwn(str text, start int, _end int, inclusive bool) - Find the Substring Between Start and End Locations

  • plvstr.betwn(str text, start text, _end text, startnth int, endnth int, inclusive bool, gotoend bool) - Find the Substring Between Start and End Locations

  • plvstr.betwn(str text, start text, _end text) - Find the Substring Between Start and End Locations

  • plvstr.betwn(str text, start text, _end text, startnth int, endnth int) - Find the Substring Between Start and End Locations

  • plvchr.nth(str text, n int) - Call this function to return the Nth character in a string

  • plvchr.first(str text) - Call this function to return the first character in a string

  • plvchr.last(str text) - Call this function to return the last character in a string

  • plvchr.is_blank(c int) - Is blank

  • plvchr.is_blank(c text) - Is blank

  • plvchr.is_digit(c int) - Is digit

  • plvchr.is_digit(c text) - Is digit

  • plvchr.is_quote(c int) - Is quote

  • plvchr.is_quote(c text) - Is quote

  • plvchr.is_other(c int) - Is other

  • plvchr.is_other(c text) - Is other

  • plvchr.is_letter(c int) - Is letter

  • plvchr.is_letter(c text) - Is letter

  • plvchr.char_name(c text) - Returns the name of the character to ascii code as a VARCHAR.

  • plvchr.quoted1(str text) - Quoted text between '''

  • plvchr.quoted2(str text) - Quoted text between '"'

  • plvchr.stripped(str text, char_in text) - Strips a string of all instances of the specified characters

Read the original on github.com ↗