Open topic with navigation
Frequently, data contains leading and/or trailing white-space characters, such as spaces and tabs, which may need to be removed prior to further processing. In DMExpress, such white space can be removed from data in the following ways:
While the Trim function provides more flexibility, the Compress all fields option may perform better if many fields require white space removal.
The Trim function can be invoked in an expression to remove leading and/or trailing white space characters from a text or date/time value in the following ways:
Trim(" text ", 'leading', ' ')
Trim(" text ", 'trailing')
Trim(" text ")
Select the Compress all fields option in the Reformat Target Layout dialog to compress all text, date/time, and displayable numeric elements in the reformat.
The character(s) to be removed depend(s) on the data type; for text and date/time data, this effectively removes all leading/trailing white space.
The Compress all fields option does not offer any choice regarding which character(s) to be removed, or which side (leading/trailing) to remove from; it depends on the data type. The Trim function offers more flexibility in both character and side choices, but can only trim text values (or values converted to text using the ToText function).
Performance-wise, the Trim function can be specified on a per-field basis, while the Compress all fields option can only be specified for the entire reformat. If only a few fields relative to the total number of fields require white space removal, you’ll likely get better performance from the Trim function; otherwise, Compress all fields will likely provide better performance.
For more information on the Trim function, see Trim function in the DMExpress Help.
For more information on expressions, see Expressions in the DMExpress Help and Named vs. Inline Expressions.
For more information on the effect of Compress all fields for different data types, see Reformat Target Layout dialog in the DMExpress Help.
Copyright © 2016 Syncsort All rights reserved.