Skip to main content
Skip table of contents

f$trim


f$trim

This function removes trailing spaces from the end of the given string. If desired, leading spaces in the string are also removed. This function should be used instead of the function: p$TDV:Util:StrTrunc.

Syntax:

Res = f$Trim( Text [,Option] )

 

Argument

Type

Meaning

 

Text

String

String to be edited

 

Option

Integer

Select if spaces are to be deleted at the beginning and/or end of the string.

1 – leading spaces are deleted

2 - trailing spaces are deleted

3 – leading and trailing spaces are deleted

This parameter is optional. If it is left out, only trailing spaces are deleted.

Result:

String

Cleaned string

Example:

Text = ' xxx '
Text = f$Trim ( Text )
→ Text = ' xxx'

Text = ' xxx '
Text = f$Trim ( Text ,3 )
→ Text = 'xxx'

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.