5b9f12118adc01a2e6d528bcd2f057e4f106880b
[swftools.git] / lib / as3 / ok / strings.as
1 package {
2     import flash.display.MovieClip
3     public class Main extends flash.display.MovieClip {
4
5         function get mystring(s="s\0s\xff") {
6             return s;
7         }
8
9         function Main() {
10             var email = "test@test.de";
11             if(email.length == 12) trace("ok 1/5");
12             if(email.charAt(4)!='@') trace("error");
13
14             var x;
15             var y:Boolean=false;
16             for(x=0;x<email.length;x++) {
17                 if(email.charAt(x)=='.') {
18                     y=true;
19                 }
20             }
21             if(y) trace("ok 2/5");
22
23             var zero1 = "test\0test";
24             if(zero1.charAt(4)!='\0') trace("error");
25             else trace("ok 3/5");
26
27             if(this.mystring.charAt(1)!='\0') trace("error");
28             else trace("ok 4/5");
29             if(this.mystring.charAt(3)!='\xff') trace("error");
30             else trace("ok 5/5");
31             trace("[exit]");
32         }
33     }
34 }
35