Skip to Content
avatar image
Former Member

Count number of characters in a string

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 14, 2009 at 09:08 PM
    stringvar x := '1133541-10-SRTN-F-630-LR';
    stringvar array z := split(x,'-');
    ubound(z)-1;
    
    Add comment
    10|10000 characters needed characters exceeded