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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Oracle
Apprentice


Joined: 29 May 2002
Posts: 121

PostPosted: Tue Sep 17, 2002 8:00 am   

Removing Commas
 
I have been looking for a way to remove commas but have come up with no ideas. I have considered the substiture commands but to no avail, it isn't working.

Any string functions available in Zmud to parse through a variable?

Thanks...
Reply with quote
Oracle
Apprentice


Joined: 29 May 2002
Posts: 121

PostPosted: Tue Sep 17, 2002 8:12 am   
 
Nevermind, I found the %replace function.
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Tue Sep 17, 2002 8:13 am   
 
#SAY %replace("This, is, a,,, test", ",", %null)
yields

This is a test

The main thing to watch out for here is that you delineate the string arguments with quotation marks.

If you are wanting to remove the commas in something matched as %1 in a trigger, something like %replace(%1, ",", %null) will not work properly since it will parse the string above as %replace(This, is, a, , , test, ",", %null), passing 8 arguments to %replace instead of the 3 it expects.

Instead, you can use %replace("%1", ",", %null) to tell zMUD to pass %1 as the first argument only.

Edit: starting posting this before you replied to yourself but you were too fast for me.


 - Charbal
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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