Skip to content

Instantly share code, notes, and snippets.

@KentarouKanno
Created October 24, 2015 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KentarouKanno/97d9af86b411974cf814 to your computer and use it in GitHub Desktop.
Save KentarouKanno/97d9af86b411974cf814 to your computer and use it in GitHub Desktop.
演算子
// ~= パターンマッチ(左辺の範囲内に右辺が有れば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