View Single Post
  #1  
Old 12-04-2008, 03:37 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
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
Reply With Quote