$alphanum
Posted by CrashB
Thursday, May 20, 2004
Description: returns all the alpha-numeric chrs in a string
Usage: $alphanum(string)
Example: $alphanum(hello there, how are you today?)
Returns: hello there how are you today
Usage: $alphanum(string)
Example: $alphanum(hello there, how are you today?)
Returns: hello there how are you today
alias alphanum {
var %i 1
var %line $replace($remove($$1-,.),$chr(32),.)
var %new $null
while %i <= $len(%line) {
var %char $mid([ %line ],[ %i ],1)
var %asc $asc(%char)
if (%asc == 46) || (%asc == 160) || ((%asc >= 48) && (%asc <= 57)) || ((%asc >= 65) && (%asc <= 90)) || ((%asc >= 97) && (%asc <= 122)) {
var %new %new $+ %char
}
inc %i
}
return $replace([ %new ],.,$chr(32))
}