Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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.

Former Member
Former Member replied
stringvar x := '1133541-10-SRTN-F-630-LR';
stringvar array z := split(x,'-');
ubound(z)-1;
0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question