Skip to content

Commit

Permalink
Merge branch 'sunnykarira-master'
Browse files Browse the repository at this point in the history
One Sided Ranges added by sunnykarira. Thankyou.
  • Loading branch information
danielpi committed Aug 8, 2017
2 parents aedbd28 + 94503ff commit 1f11222
Showing 1 changed file with 21 additions and 0 deletions.
Expand Up @@ -88,6 +88,27 @@ for i in 0..<count {
print("Person \(i + 1) is called \(names[i])")
}

// One-Sided ranges
for name in names[2...] {
print(name)
}
// Brian
// Jack

for name in names[...2] {
print(name)
}
// Anna
// Alex
// Brian

for name in names[..<2] {
print(name)
}
// Anna
// Alex


// Logical Operators
let allowedEntry = false
if !allowedEntry {
Expand Down

0 comments on commit 1f11222

Please sign in to comment.