Trim both sides (trim)
Removes the white space from the beginning and the end of a string.
How does it work in the search window?
This operation needs only one argument:
|String to be trimmed (mandatory)||string|
The data type of the new column is string.
We want to remove the blank spaces at both sides of the values in one of the columns of this file.
To try this example, first upload the file as a lookup table (name it trim_operations). Once uploaded, go to Data Search → Finder and access the my.lookup.trim_operations table.
Then, select Create column from the query toolbar and select Trim both sides as the operation. The arguments needed are:
- String to be trimmed - trim_both column
The result is not visible in the interface, since the search window table automatically trims blank spaces at both sides of the strings. Select Download from the toolbar and download the data as a CSV to see the data trimmed.
How does it work in LINQ?
Use the operator
as... and add the operation syntax to create the new column. This is the syntax of the Trim both sides operation:
Copy the following LINQ script and try the above example: