Flash / Flex / ActionScript/String/Compare

Материал из Web эксперт
Перейти к: навигация, поиск

Convert string to lowercase then compare

 
package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var example:String = "Cool. This is a cool as both cool (lowercase) and Cool.";
        
        var search:String = "cool";
        
        trace( example.toLowerCase(  ).indexOf( search ) );
    }
  }
}