String Functions

String Trim

Format – StringTrim(SourceString, TrimType)
Use this function when you need to trim whitespace from a String.

Examples:
{StringTrim(”     String     “)} – This will default to trimming both ends of the string e.g. “String.
{StringTrim(”     String     “, LEADING)} – This will remove white space just at the beginning of the string e.g.”String     ”

 

String Replace

Format – StringReplace(SourceString, FindString, ReplaceString)
Use this function when you need to modify parameterize a body of text. 

Examples:
{StringReplace(“Dear Customer”, “Customer”, CustomerName)} – Where CustomerName is a Variable e.g. “Dear David”.
{StringReplace(Template, “TODAYSDATE”, TODAY)} – Where Template is a file from the file system with the text “Today is TODAYSDATE” e.g. Today is 2015-01-16.

 

String Normalize

Format – StringNormalize(SourceString,trimlines)
Use this function when you need to compare strings. 

Examples:
{StringNormalize(“Extra space              Extra space”)} – Remove consecutive whitespace  e.g. “Extra space Extra space”.
{StringNormalize(“Carriage return\r\nCarriage Return”)} – Replace carriage return and line feed with line feed e.g. “Carriage return\nCarriage Return”.
{StringNormalize(”        leading and end space       “)} – Remove leading and trailing whitespace e.g. “leading and end space”.
{StringNormalize(”        leading and end space   “} – Option to remove leading and trailing spaces for each line e.g. “leading and end space\ntest lines” test lines      “,true)}

 


2017-05-12T11:35:04+00:00

Leave A Comment