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
(2,590 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, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
Message 2 of 2
(2,562 Views)