From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Count number of substrings in a string

Solved!
Go to solution

I'm using TestStand 2016 and want to count the number of substrings. Is there any method or do I have to loop the whole string (trim, count ...)

 

The Find() function returns only if string contains a substring but not the total number of occurances

0 Kudos
Message 1 of 2
(1,894 Views)
Solution
Accepted by topic author Struct

How about SearchAndReplace? It returns Number numReplacements.

 

String SearchAndReplace(String string, String searchString, String replacementString, Number startIndex = 0, Boolean ignoreCase = False, Number maxReplacements = -1, Boolean searchInReverse = False, [Out] [Number numReplacements])

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
Message 2 of 2
(1,866 Views)