-
[RESOLVED] Delete the first character in an item in an array
How would I go about removing only the first character of an item in an array? All my items are strings, so for example I want to turn this:
pseudo code:
Array["01234","01234"]
to this:
Array["1234","1234"]
Or if that isn't possible, I could just turn each element into a string, modify it and re-Array it. The issue is using split(charAt(0)) isn't correct syntax. I just don't know what function to call and every search turns up only replacing specific characters, not character at a position.
Last edited by Rajada; 04-20-2011 at 10:12 PM.
-
Actionscript strings are immutable, which means that they cannot be changed in place. But you can replace the String in the array.
To get the substring of a String which is everything except the first letter, do:
Code:
var yString:String = myString.substring(1);
-
Okay, that works, thanks.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|