Advanced Text

From UBot Playground
Jump to: navigation, search

The Advanced Text Functions consists of functions specific to the manipulation and utilization of text.


List of Advanced Text Functions[edit]

  • Number Format: Places commas into numbers to make the numbers readable.
  • Clean Text: Trim and replace multiple spaces with a single space.
  • Character List: Returns a list of individual characters within a string.
  • Swap Case: Returns a copy of the string in which all the case based characters have their case swapped.
  • Count Text: Counts the number of times a substring appears in text.
  • Escape HTML: Converts HTML characters to their entity equivalents.
  • Unescape HTML: Converts entity characters to their HTML equivalents.
  • Is Blank: Determines whether text is empty or contains only white space. Returns True or False.
  • Is Number: Determines whether text is a number. Returns True or False.
  • Starts With: Checks whether a string begins with specified text.
  • Ends With: Checks whether a string ends with specified text.
  • Camelize: Converts underscored or dasherized string into a camelized one. Begins with a lower case letter unless it starts with an underscore, dash or uppercase letter.
  • Classify: Converts string to camelized class name. First letter is always upper case.
  • Underscored: Converts camelized or dasherized string to an underscored one.
  • Dasherize: Converts camelized or underscored string to dasherized one.
  • Humanize: Converts an underscored, dasherized or camelized string into a humanized one. Also removes beginning and ending whitespace, and removed the postfix '_id'.
  • Truncate: Cuts text at a specific location, replacing it with "...".
  • Prune: Elegant version of truncate. Makes sure the pruned string does not exceed the original length. Avoid half chopped words when truncating.
  • Words: Returns a list of words from a specified text.
  • Repeat Text: Repeat strings a specified number of times.
  • Sluggify: Transforms text into an ascii slug which can be used safely in urls. Replaces whitespaces, accentuated and special characters with a dash. Limited set of non-ascii characters are transformed into similar versions in the ascii character set such as ä to a.