SCOUG-Programming Mailing List Archives
Return to [ 17 |
September |
1998 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
On Thu, 17 Sep 1998 15:36:03 PDT, Rollin White wrote:
>Is there a clean way to collect all of the numeric data from a string. For example, given:
>
>abc123def456ghi
>
>I want 123456
I'll answer my own question. Turned out to be easier than I thought:
/* */
PARSE ARG input
Output = ''
do i = 1 to length(input)
if DATATYPE(SUBSTR(Input,i,1)) = 'NUM' then
Output = Output||SUBSTR(Input,i,1)
end
say Output
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 17 |
September |
1998 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|