[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: find out alpha, numeric in a string
- Subject: Re: find out alpha, numeric in a string
- From: Cherno Jagne <ITSCJ@QE2-HSC.NS.CA>
- Date: Wed, 23 Aug 2000 18:12:25 -0300
Madav,
You might want to search the sqr archives at www.sqrug.com
because I think a variation of your question has been answered
here several times. Still, the following snippet of code would
be how I would've approached it:
let $alphanum = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
let #has_alphanum = 36 -
length(translate($alphanum,upper($source_str),''))
if #has_alphanum is 0, then $source_str contains no alphanums,
otherwise it contains at least one alphanum.
Hope that helped. You may want to read up on the translate
function if you don't understand the code, or I can explain it later.
Cherno.
>>> Madav V <vmadav@HOTMAIL.COM> 08/23 11:52 AM >>>
I got problem in finding out alphabetics or numeric values in a
string.
Here is an example for my problem.
There are the strings: 1) AB5--C99
2) **
3) ---
4) D*-
5) 8-~$
I need to find out the string which doesn't contain alphabetic or
numeric, i.e. example 2 and 3. or I need to find out the string which
does
contain atleast one value of alphabetic or numueric, i.e example 1 , 4
and
5.
Your help is appreciated.
Thanks,
Madav
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com