|
Gael Beginner
Joined: 18 Sep 2006 Posts: 29
|
Posted: Fri Apr 03, 2009 10:11 pm
[2.37] How can I split a paragraph coming in from the mud into words? |
Hi gurus,
I'm looking for a way to take an incoming paragraph and split it into an array of words. I didn't find anything like a %split() function in the help, though the %word() func looks like it has promise.
I can probably kludge something together manually, but I thought I'd ask here first so I don't re-invent the wheel.
Thanks much in advance. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Fri Apr 03, 2009 10:12 pm |
yea, its the %word function that does this
you could also do:
paraWords=%replace(@paragraph, " ", "|") |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Gael Beginner
Joined: 18 Sep 2006 Posts: 29
|
Posted: Fri Apr 03, 2009 10:16 pm |
Thanks for the quick reply. The
Code: |
paraWords=%replace(@paragraph, " ", "|") |
looks pretty slick and should be just what I'm looking for.
I thought %word just picked out the nth individual word from an input string? I'm looking for the whole array. If I'm wrong, could you please post a code example? |
|
|
|
|
|