var myString:String = "Thi$i$a T#%%Ible Exam73@";
and make myString = “thiiatibleeam”;
Or another example
var myString:String = "Totally Awesome String";
And make myString = “totallyawesomestring”;
Thank you in action 3!
var str:String = "Thi$i$a T#%%Ible Exam73@";
str = str.toLowerCase(); //thi$i$at#%%ible exam73@
str = str.replace(/[^az]/g,""); //thiiatibleexam
Regular expression means:
[^az] - any character *not* in the range az
/g - global tag means find all, not just find one
What is the best way to simply use strings
var myString:String = "Thi$i$a T#%%Ible Exam73@";
and make myString = “thiiatibleeam”;
Or another example
var myString:String = "Totally Awesome String";
And make myString = “totallyawesomestring”;
Thank you in action 3!
Extending the answer of @Sam OverMars, you can combine String’s replace method with Regex and String’s toLowerCase method to get what you want.
var str:String = "Thi$i$a T#%%Ible Exam73@";
str = str.toLowerCase(); //thi $i$at#%%ible exam73@
str = str.replace(/[^az]/g,""); //thiiatibleexam
Regular expression means:
[^az] - any character *not* in the range az
/g - global tag means find all, not just find one
< /p>