Created
October 24, 2015 01:48
-
-
Save KentarouKanno/97d9af86b411974cf814 to your computer and use it in GitHub Desktop.
演算子
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ~= パターンマッチ(左辺の範囲内に右辺が有ればtrue) | |
200 //=> Contains | |
300 //=> Not Contains | |
let status = 299 | |
//=> Contains | |
if (200 ..< 300) ~= status { | |
print("contains") | |
} else { | |
print("Not contains") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment