Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extract numbers from string
Message
From
07/01/2003 07:53:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/01/2003 13:29:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00738451
Message ID:
00738707
Views:
16
>Hi
>
>i have one string
>
>lcString = "18,21,33,45,150,999"
>
>I want extract numbers
>
>18
>21
>33
>45
>150
>999
>
>"," is separator between numbers
>
>thanks

In VFP6 and up you could use alines(). Prior to VFP6 below is another alternative (and for short lists faster than alines) :
oDummy = createobject('Listbox')
with oDummy
  .RowSourceType = 1 && Value
  .RowSource = tcStr
  dimension arrElems[.ListCount]
  for ix=1 to .ListCount
    arrElems[ix] = .List(ix)
  endfor
endwith
release oDummy
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform