
12-04-2008, 03:37 AM
|
master of infinite loops
|
 |
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
|
|
Add array range to new array
To get back in to scripting things other than GUIs and HP systems, I've decided to try and recreate PHP's explode() and implode() functions. I'm wondering, however, is there already an existing way to add an array range to a new array? Or will I have to script my own?
For instance, explode() has three parameters: delimiter, string, limit. If limit is set to a positive number that is less than the string's length when tokenized by the delimiter, it will add each token, with the last one containing the rest of the string. So, if my string is "1,2,3,4,5", my delimiter is ",", and my limit is 3, the output would be: {1, 2, "3,4,5"}. |
__________________
"We are all in the gutter, but some of us are looking at the stars."— Oscar Wilde, Lady Windermere's Fan
|
|
|