Topic: DMD0172

Help File Version: 2.10.0.636

STRTRIM - Trim Whitespace


The Trim Whitespace (STRTRIM) instruction will remove all whitespace characters from the beginning and / or end of a String. Whitespace characters between characters in the string are not removed. Whitespace characters typically represent horizontal or vertical space, the ones the Trim Whitespace instruction will remove are Space <SP>, Horizontal Tab <TAB>, Carriage Return <CR>, Line Feed <LF>, Form Feed <FF>, Vertical Tab <VT>.

 

 


Parameters:

Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.

 

String - the String that contains the data to be trimmed. This can be any writable user-defined or system-defined String.

 

Trim - selects which end or ends of the string to trim:

Leading - from the beginning of the string, working forward to the first non-whitespace character. The first non-whitespace character will become the first character in the string after the STRTRIM completes.
 

Trailing - from the end of the string working backward to the first non-whitespace character. The final non-whitespace character in the string will become the final character in the string after the STRTRIM completes.

 


Status Display:

Before executing the STRTRIM instruction:

 

After executing the STRTRIM instruction:

 

The Status display will only show as many of the characters of the String as will fit within the borders of the instruction, typically this is about 50 characters.

 


See Also:

STR2REAL - Convert String to Real

 

STR2INT - Convert String to Integer

 

STRCASE - Convert String to UPPER / lower Case

 

STRCLEAR - Clear Strings

 

STRCMP - String Compare

 

STRCOPY - Copy String

 

STRCOPYR - Copy a Range of Strings


STRDELETE - Delete Substring

 

STRFIND - Find within String

 

STRINSERT - Insert Substring

 

STRPRINT - Print to String

 

STRSUB - Get Substring

 

STRTRIM - Trim Whitespace

 

STRTRUNC - Truncate String

 


Related Topics:

String Functions Overview

 

String Scripting Language Reference

 


Rung Example: