View previous topic :: View next topic
|
Author |
Message |
sowmyasridhar15
New User
Joined: 13 Mar 2008 Posts: 5 Location: Bangalore
|
|
|
|
Hi
I just want to know if there is any method to find a character in a string.
Example: MUSCATINE##IOWA##USA
I need to know how many times '##' occurs in the string...Please help... |
|
Back to top |
|
|
daye.Zheng
New User
Joined: 15 Feb 2008 Posts: 22 Location: China
|
|
|
|
Using inspect!
For example:
INSPECT stringdata TALLYING counter FOR ALL "#'
you can got it. |
|
Back to top |
|
|
shrivatsa Warnings : 1 Active User
Joined: 17 Mar 2006 Posts: 174 Location: Bangalore
|
|
|
|
Its
Code: |
INSPECT String-data TALLYING counter FOR ALL '##'. |
as he asked for '##' |
|
Back to top |
|
|
sowmyasridhar15
New User
Joined: 13 Mar 2008 Posts: 5 Location: Bangalore
|
|
|
|
Hi...
Thank You...STRING worked... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post the STRING code that works. |
|
Back to top |
|
|
sowmyasridhar15
New User
Joined: 13 Mar 2008 Posts: 5 Location: Bangalore
|
|
|
|
The code that worked was
Code: |
INSPECT String-data TALLYING counter FOR ALL ' '. |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
how nice. magic code! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Thank You...STRING worked... |
Quote: |
The code that worked was
Code: |
INSPECT String-data TALLYING counter FOR ALL ' '. |
|
Not to make too fine a point, but the code that worked is an INSPECT rather than some string/unstring operation. Also, the code posted will find spaces rather than #(s) which i believe was the original requirement.
FWIW. |
|
Back to top |
|
|
|