mirror of
https://github.com/Fechin/reference.git
synced 2026-11-22 14:01:45 +03:00
Added Range Operators in Swift
This commit is contained in:
1 parent
6befdec028
commit
3c8d65772f
1 file changed
+13
@@ -436,6 +436,19 @@ if weather == "sunny" {
|
||||
|
||||
|
||||
|
||||
### Range Operators
|
||||
|
||||
```swift
|
||||
a...b // numbers between a and b (including both a and b)
|
||||
a..<b // numbers between a and b (including a but excluding b)
|
||||
...b // numbers till b (including b)
|
||||
```
|
||||
|
||||
-`a...b` Closed Range
|
||||
-`a..<b` Half-Open Range
|
||||
-`...b` One-Sided Range {.style-round cols-2}
|
||||
|
||||
|
||||
### Ternary conditional operator
|
||||
|
||||
```swift
|
||||
|
||||
Reference in new issue
Block a user