View previous topic :: View next topic
|
Author |
Message |
Lord.of.Wind
New User
Joined: 17 Nov 2005 Posts: 60
|
|
|
|
Dear all:
Could you tell me how to how to count the appearance of a char, besides copying it into an array and count the apperance in a loop?
For instance,
How to count the appearance of 'm' in 'ibmmainframes.com' --- how many 'm's in 'ibmmainframes.com'?
Thank you! |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
How to count the appearance of 'm' in 'ibmmainframes.com' --- how many 'm's in 'ibmmainframes.com'? |
Code: |
WS-STRING PIC X(30) Value 'ibmmainframes.com'.
WS-CNTR PIC X(99) Value ZEROES.
INSPECT WS-STRING TALLYING WS-CNTR FOR "m" |
|
|
Back to top |
|
|
|