Remove every instance of a particular character : String : String Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » String » String »

 

Remove every instance of a particular character


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var example:String = "a string";
        var characters:Array = example.split"" );
        
        for var i:Number = 0; i < characters.length; i++ ) {
          if characters[i== "r") {
            characters.splicei, );
            i--;
          }
        }
        tracecharacters.join"" ) );
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo String
» String