Added Range Operators in Swift

This commit is contained in:
Saksham Shrey authored and GitHub committed 2024-02-26 12:29:19 +05:30
1 parent 6befdec028
commit 3c8d65772f
1 file changed
+13
+13
View File
@@ -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