Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another question about characters in flash

Status
Not open for further replies.

whoknows361

Technical User
Sep 22, 2005
228
US
I am running into some problems with some character strings.
such as: I want to remove the first character in a variable which is passed (ie. the dollar sign).
Also, I want to measure the length of characters
and I wnat to be able to edit certain characters in a variable which is passed (lets say the fifth character).

Can someone point me a good tutorial on this type of editing - how to manipulate passed variables and strings.

I have checked but can't find anything substantial.
Thanks

Jonathan
 
Code:
var rawString:String = "$someString";
var newString:String = rawString.slice(1);
trace("newString: " + newString);

var len:uint = newString.length;
trace("len: " + len);

var arr:Array = newString.split("");
arr[3] = "a";
newString = arr.join("");
trace("newString: " + newString);
Output
newString: someString
len: 10
newString: somaString

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top