Developer Documentation Library > Scripting > UNICOM Intelligence Function Library > Text functions > Trim
 
Trim
Returns a copy of a string with any leading and trailing spaces removed.
Syntax
Trim(Val)
Parameters
Val
Type: Text
Text value from which you want to remove leading and trailing spaces. See also Specifying text strings as arguments.
(return)
Type: Text
Copy of Val with leading and trailing spaces removed.
Remarks
Trim removes white space (such as space and tab characters) that appears at the beginning and end of the input string. Trim uses the rules of the input locale when interpreting white space.
If the current data value is NULL, Val is "" and the return value is "".
Example
This example uses the Trim function to return a copy of the contents of the address variable with any leading and trailing spaces removed:
address.Trim()
For an example of using Trim in combination with UCase and Mid, see UCase. For a data cleaning example, see Example 4: Cleaning other question types.
See also
AscW
Text functions