This content has been marked as final. Show 4 replies
if you are familiar with regular expressions, regexp may be the best solution ( http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_11.ht ml).
You can use the subtr method of the String class if the offset of the search strings are fixed (or already known)
Take a look at String.split() method.
var s:String = " 2.02, 20$ / 40$";
var a:Array = s.split(",");
var b:Array = String(a).split("/");
trace(b + ", " + b);
Is the following is a good approach?
It really depends on if and how this data might change in the future. If the number will always be followed by a $, then it is probably best to use a regular epression that makes use of \d+\$ which captures all digits before the $, and also that character.