[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Extract only numbers of a string

  • Thread starter Thread starter jonathan.wilson
  • Start date Start date
Status
Not open for further replies.
J

jonathan.wilson

Guest
Assuming only one number in string.. the following will work like some examples above. DEF VAR i AS INT NO-UNDO INIT 1. DEF VAR myNum AS CHAR NO-UNDO INIT "". def var myString as char no-undo. myString = 'this is a 1234 tekst'. DO WHILE i 0 THEN myNum = myNum + SUBSTRING(myString,i, 1). i = i + 1. END. MESSAGE myNum int(myNum) VIEW-AS ALERT-BOX.

Continue reading...
 
Status
Not open for further replies.
Back
Top