I’m creating a flash application, which loads a file from a server, and stores it in a string. I’m wanting to find the substring within that string, which is inbetween two known substrings.
Note. I don’t want to do this with reg-ex as i’d like it to be easily reusable.
Ideally I’d like a function which i can re-use, by passing the beginning and ending substrings.
e.g. something along these lines..
function getSubString(start:String, end:String):String
I’m struggling on this one. If anyone can help it’d be much appreciated. Thank you.
No doubt this is one of those questions that gets the answer “Why didn’t you just google it..”. I have done, and didn’t find much! Sorry!
Edit: There may be more than one instance of the ‘start’ and ‘end’ substrings within the string, i’m wanting it between the first instance of each.
I haven’t tested it so you may find an off by 1 error.