Reemplazar string


/ Published in: ActionScript
Save to your folder(s)

Busca y reemplaza un texto por otro en un string.


Copy this code and paste it in your HTML
  1. function replaceString(myString:String, replaceThis:String, withThis:String):String {
  2. var split_ar = myString.split(replaceThis)
  3. myString = split_ar.join(withThis)
  4. return myString;
  5. }
  6.  
  7. textoVar = replaceString ("hola pepe, como estas"," ","_");

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.