To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI shows two approaches to count a specific character within a string.
Description
This VI shows two different ways to count how many times a character occurs within a string. In a first way, LabVIEW converts the string to a byte array and then indexes through each byte using a For Loop. LabVIEW compares each byte to the *. In a second way, LabVIEW uses a While Loop to iteratively parse through the incoming string. The example uses * as the character to search for.
Requirements
LabVIEW Base Development System (or compatible)
Steps to Implement or Execute Code
1. Run the VI
2. Change the string by adding more characters with *
3. See the change
Additional Information or References
**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.
delete
What about something like this:
Search and Replace String tells you and (I'm guessing) is probably no slower especially if you set the replacement string to be the same length as the search string: