trim

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Availability

This routine is available starting with SIL Engine™ 2.0.2 for Jira 5.x or SIL Engine™ 1.1.9 for Jira 1.1.9.

Syntax

trim(str)

Description

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

Parameters

Parameter name

Type

Required

Description

str

string

Yes

String to trim.

Return type

string

Example

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


Notes

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