Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.