StrTrim
- Last UpdatedOct 29, 2026
- 1 minute read
Removes spaces from a string.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
StrTrim |
String |
Synchronous |
Yes |
Supported |
Supported |
Supported |
Supported |
Supported |
Syntax
StrTrim(strReference, optNumFlag)
strReference
A string, or a string tag that contains the source string.
optNumFlag
An optional integer or integer tag:
|
Value of optNumFlag |
Description |
|---|---|
|
0 |
Removes all spaces from both the beginning and the end of the string. |
|
1 |
Removes all spaces only from the beginning of the string. |
|
2 |
Removes all spaces only from the end of the string. |
|
3 |
Removes all spaces except for single spaces between words. |
Note: If no value is given for optNumFlag, then 0 is the default.
Returned value
This function returns a string equal to strReference minus the removed characters.
Examples
|
Tag Name |
Expression |
|---|---|
|
Tag |
StrTrim(" Studio version 7.0 ") // Return value = "Studio version 7.0" |
|
Tag |
StrTrim(" Studio version 7.0 ", 0) // Return value = "Studio version 7.0" |
|
Tag |
StrTrim(" Studio version 7.0 ", 1) // Return value = "Studio version 7.0 " |
|
Tag |
StrTrim(" Studio version 7.0 ", 2) // Return value = " Studio version 7.0" |
|
Tag |
StrTrim(" Studio version 7.0 ", 3) // Return value = "Studio version 7.0" |