|
Amfitrion Wanderer
Joined: 29 Sep 2001 Posts: 75 Location: Israel
|
Posted: Thu Jan 24, 2002 11:46 pm
Explode |
There is a command in LPC named explode.
Is there something like this in zmud?
- Amfitrion. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Jan 25, 2002 12:38 am |
I am not versed in LPC, is that some new type of drug? Anyhow, I don't think anyone is going to be able to tell you if there is something similar unless you tell us what "explode" does.
|
|
|
|
Amfitrion Wanderer
Joined: 29 Sep 2001 Posts: 75 Location: Israel
|
Posted: Fri Jan 25, 2002 12:51 am |
You are right. Here is what explode does:
"explode() takes two strings as arguments, the first is the string you want to break up, and the second is the pattern that explode() looks for as a marker of where to break the string. It returns an array of strings holding the result."
So if there is a string containing the follow data: "one and two and three", if you do:
explode("one and two and three", " and ")
you will get three strings as output:
String 1: "one"
String 2: "two"
String 3: "three"
There is implode function that does the opposite.
- Amfitrion. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jan 25, 2002 2:06 am |
quote:
There is a command in LPC named explode.
Is there something like this in zmud?
- Amfitrion.
The closest things I can think of would be %numwords() for explode() and %concat() for implode().
%numwords() allows you to find the number of "word"-sized text strings based on what the divider is (by default it's a space, but you can specify what you like as a second parameter).
%concat() will take any number of string parameters and connect them all into one long string.
li'l shmoe of Dragon's Gate MUD |
|
|
|
dacheeba Adept
Joined: 29 Oct 2001 Posts: 250
|
Posted: Fri Jan 25, 2002 2:21 am |
quote: %concat() will take any number of string parameters and connect them all into one long string.
ANY number of string parameters? Help file says up to nine...if so this, this command may help me with the problem im having. |
|
|
|
|
|