Trim Text Blanks

Verb: trimString

Trims blank spaces at the start and/or the end of a text.

Syntax

trimString --text(String) --trimoption(TrimOptions) (String)=value

Inputs

Script Designer Required AcceptedTypes Description
--text Text Required Text Text that should have its leading and/or trailing blanks trimmed.
--trimoption Trim option Required TrimOptions Type of blank space removal.
  • Trim end
  • Trim start
  • Trim start and end
  • Outputs

    Script Designer AcceptedTypes Description
    value Text Text Text with blanks trimmed as indicated by Trim option.

    Example

    Removes blanks spaces at the end of the text "IBM ".

    defVar --name textToTrim --type String --value "IBM  "
    defVar --name trimmedText --type String
    // Trim blanks only at the end (--trimoption "TrimEnd")
    trimString --text "${textToTrim}" --trimoption "TrimEnd" trimmedText=value
    logMessage --message "${trimmedText}" --type "Info"
    // This example produces the following result:
    // "IBM".
    

    See Also

  • Add Escape Characters to Regular Expression
  • Add Escape Characters to Text
  • Calculate Hash
  • Change Text Case
  • Check File
  • Concatenate Texts
  • Convert HTML to Text
  • Count Occurrences in Text
  • Count Text Characters
  • Create Random Text
  • Create Table By Regular Expression
  • Empty or Null Text Variable
  • Find by Regular Expression
  • Find Occurrences in Text
  • Format Text
  • Get Subtext
  • Get Text from Regular Expression
  • HTML to Markdown
  • Insert New Line to Text
  • Join Text
  • Pad Text
  • Parse URI
  • Remove Diacritics
  • Remove Escape Characters
  • Replace Part of Text
  • Replace Text
  • Split Text