Use a for loop to check whether a string contains the @ character : For : Statement Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Statement » For »

 

Use a for loop to check whether a string contains the @ character


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var address = "me@moock.org";
        var isValidAddress = false;
        
        for (var i = 0; i < address.length; i++) {
          if (address.charAt(i== "@") {
            isValidAddress = true;
            break;
          }
        }
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Statement
» For