Using toUpperCase() or toLowerCase() to make sure that two strings are compared without regard to case : Case : String Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » String » Case »

 

Using toUpperCase() or toLowerCase() to make sure that two strings are compared without regard to case


 

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

         var inputPW:String = "HaXoR"
         var storedPW:String = "haxor";
        if (storedPW.toLowerCase() == inputPW.toLowerCase()) {
             trace("Login successful");
        else {
            trace("Login error");
        }

    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo String
» Case