To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI can be used as a subVI to remove a trailing space from a string.
Description
A trailing space is a space following the last character of a string. For example, "test " contains a trailing space, but "test" does not. Running this VI would convert "test " to "test" by removing the trailing space.This sub VI in a For Loop to remove trailing spaces from each string in the array.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
What's wrong with just using the built in Trim White Spaces? There is an option to have it only trim the end. This way you can remove multiple spaces that are trailing (which I have ran into plenty of times).
Hi crossrulz,
The built-in Trim Whitespace VI will remove all spaces, tabs, carriage returns, and linefeeds. There are times when you may want to cycle through many strings and remove the spaces, but leave tabs or carriage returns at the ends of other strings. Basically, this gives you a little more specificity.