- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
Kobusvdwalt · Oct 18, 2013 at 11:52 AM ·
stringstring formatting
Creating a Token At function
Hi there, I am trying to create a function that will allow me to give a Source string, integer index and a separator string as parameters. And the function will return the text that occurs in between the separators at the specified count in a string. Example :
var text : string ;
text = TokenAt("a//b//c//d//e//f//g",4,"//")
text
would then be equal to 4;
This is where I am getting this function from : https://www.scirra.com/manual/126/system-expressions
tokenat(src, index, separator) Return the Nth token from src, splitting the string by separator. For example,tokenat("apples|oranges|bananas", 1, "|") returns oranges.
Any help is appreciated, just ask if I need to clarify anything.
Comment