Word$() Command?

Just starting out? Need help? Post your questions and find answers here.
shadow382
New User
New User
Posts: 3
Joined: Tue Apr 22, 2008 2:30 pm

Word$() Command?

Post by shadow382 »

I've been writing a program in another BASIC language, but have decided to switch to PureBasic. In the other language, there is a "word$()" command. I use it to extract specified text from a string.

Ex:

Code: Select all

string$ = "width=640"
n$ = Trim$(Word$(string$, 2, "="))
This would give me the text that comes after "=" in the string. My question is, what is the equivalent of this command in PureBasic? I've looked through the help file, but with no luck. I'm not sure what it would be called in PureBasic.

Thanks, in advance, for your help!
Last edited by shadow382 on Tue Apr 22, 2008 2:38 pm, edited 1 time in total.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

StringField() should give you what you need.
I may look like a mule, but I'm not a complete ass.
shadow382
New User
New User
Posts: 3
Joined: Tue Apr 22, 2008 2:30 pm

Post by shadow382 »

I feel stupid now. I saw that when I was searching, but just skimmed right over it. Anyway, it is what I need and thanks for your help!
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

shadow382 wrote:I feel stupid now......
Don't worry about that, you have a long way to go yet before your level of stupidity could possibly match mine! :wink:
I may look like a mule, but I'm not a complete ass.
Post Reply