cancel
Showing results for 
Search instead for 
Did you mean: 

Count number of characters in a string

Former Member
0 Kudos

Another one for you experts:

Is there a way to count the number of "-" in the strings below:

For instance:

1133500-1-RTN-629-RHR

1133541-10-SRTN-F-630-LR

Should return:

4

5

respectively.

Any ideas?

Thanks in advance,

Zack H.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

stringvar x := '1133541-10-SRTN-F-630-LR';
stringvar array z := split(x,'-');
ubound(z)-1;
Former Member
0 Kudos

Good job Sanjay. Masterpiece.

Answers (0)