4.04 String Trimming and Squeezing

TRIM

Function:

Removes leading and trailing white-spaces from string s. TRIM is equal to LTRIM(RTRIM(s))

Syntax:

TRIM(s)

Example:

put trim("  Hi  "))  // "Hi"
put trim("      "))  // ""

TRIML

Function:

Removes leading white spaces from string s

Syntax:

TRIML(s)

Example:

put triml("  Hi  "))  // "Hi  "
put triml("      "))  // ""

TRIMR

Function:

Removes trailing white-spaces from string s

Syntax:

TRIMR(s)

Example:

put trimr("  Hi  "))  // "  Hi"
put trimr("      "))  // ""

SQUEEZE

Function:

Removes leading, trailing and repeated white spaces within the string.

Syntax:

SQUEEZE(s) 

Example:

put "[": squeeze(" Hi  there "): "]"  // "[Hi there]"

lynplex/lp0404.txt · Last modified: 2012/09/08 15:05 (external edit)