Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Gael
Beginner


Joined: 18 Sep 2006
Posts: 29

PostPosted: 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.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Apr 03, 2009 10:12 pm   
 
yea, its the %word function that does this

you could also do:

paraWords=%replace(@paragraph, " ", "|")
_________________
Discord: Shalimarwildcat
Reply with quote
Gael
Beginner


Joined: 18 Sep 2006
Posts: 29

PostPosted: 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?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net