Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

trim(str)

Package


Alias


Pkg Usage


Description

Excerpt
hiddentrue

Returns a trimmed copy of the string passed as parameter with the leading and trailing whitespaces removed.

Returns a trimmed copy of the string passed as parameter with the leading and trailing whitespaces removed.

...

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

Parameter name

Type

Required

Description

str

String

Yes

String to trim.

Return Type

String

Example

Code Block
languagejs
string original = "   foobar   ";
string trimmed = trim(original);
print(">>" + original + "<<"); // will print ">>   foobar   <<"
print(">>" + trimmed + "<<");  // will print ">>foobar<<"

...

Note

This also works if the string passed in as parameter only has leading or trailing whitespaces. If the string has no leading or trailing whitespaces, a copy of the original string will be returned.


See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "string_routine" and space = currentSpace ( )
labelsarray_routines