Skip to content

Instantly share code, notes, and snippets.

@danielctull
Created November 29, 2015 08:33
Show Gist options
  • Save danielctull/4c40f8a492b21ee2bb4d to your computer and use it in GitHub Desktop.
Save danielctull/4c40f8a492b21ee2bb4d to your computer and use it in GitHub Desktop.
let integerToDescribe = 5
var description = "The number \(integerToDescribe) is"
switch integerToDescribe {
case 2, 3, 5, 7, 11, 13, 17, 19:
description += " a prime number, and also"
}
description += " an integer."
print(description)
// prints "The number 5 is a prime number, and also an integer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment