Thread: Array Slicing
View Single Post
  #11  
Old 11-11-2009, 01:49 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
Quote:
Originally Posted by coreys View Post
Make it harder? This would make it easier, and clearer. x.x
And redundant. A new scripter would be wondering, "What is the correct syntax? Do they do different things? Why are there two ways to do this? Am I doing it wrong if I do it this way?" etc.

Different languages have different ways of doing things. Python has this syntax. PHP has the array_slice() and substr() functions. GS2 has .subarray() and .substring().

Quote:
Originally Posted by Tigairius View Post
Personally, I just wish GS2's substring supported something like string.substring(-1) which would take off 1 character from the back of the string, rather than having to write out: string.substring(0, string.length() - 1)
That seems like it wouldn't be terribly difficult to do.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote