2013-03-17 65 views

回答

1

類似下面應該做的伎倆:

private function isBinary(str:String):Boolean 
{ 
    var binary:Boolean = true; 

    for (var i:int = 0; i < str.length; i++) 
    { 
     if (str.charAt(i) != "0" && str.charAt(i) != "1") 
     { 
      binary = false; 
      break; 
     } 
    } 
    return binary; 
} 
+0

它的工作原理神奇!謝謝 :) – user2179694 2013-03-17 16:44:50

相關問題