I prefer to use the string.substr() or string.substring() functions. for string.substring() The first number is the start index, the last number is the end index. For string.substr() it the index of the first char and how many to take from there
Hard to explain so Ill give an example:
Code:
myStr = "Have a nice day!";
a = myStr.substring(0,4);
b = myStr.substring(5,6);
c = myStr.substring(7,11);
d = mystr.substring(12);
trace("a = " + a);
trace("b = " + b);
trace("c = " + c);
trace("d = " + d);
or
Code:
myStr = "Have a nice day!";
a = myStr.substr(0,4);
b = myStr.substr(5,1);
c = myStr.substr(7,4);
d = mystr.substr(12);
trace("a = " + a);
trace("b = " + b);
trace("c = " + c);
trace("d = " + d);
Give the same result.
They work a little diffrently so try them out and see wich one is best for you.