ZenScript main repository
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

match.zs 419B

1234567891011121314151617181920212223242526
  1. val test as int = 10;
  2. val tt1 = "tt";
  3. val tt2 = "tt3";
  4. val tt4 = "tt5";
  5. println(match 10 {
  6. 1 => "one",
  7. 10 => "yo",
  8. //tt1 === "tt1" for some compiler issue it takes the variable as string input?
  9. 100 => match tt1 {
  10. "10" => "t",
  11. "tt1" => tt1,
  12. "tt2" => tt1 + tt4,
  13. default => tt4
  14. },
  15. default => tt2
  16. });
  17. println(tt1);
  18. //println(match test {
  19. // case 1 : "tt",
  20. // default : "kk"
  21. //});