or UnCountable ? // Countable let countableRange1 = 0...0 let countableRange2 = 10..<100 // UnCountable let unCountableRange1 = 0.2...19.5 let unCountableRange2 = 0..<20.0
or UnCountable ? // Countable let countableRange1 = 0...0 let countableRange2 = 10..<100 // UnCountable let unCountableRange1 = 0.2...19.5 let unCountableRange2 = 0..<20.0
or ClosedRange (ด۠ؒ or ։۠ؒ)? // Range(半開区間) let range1 = 0..<10 let range2 = 0.0..<10.0 // ClosedRange(閉区間) let closedRange1 = 0...10 let closedRange2 = 0.0...10.0
or ClosedRange (ด۠ؒ or ։۠ؒ)? // Range(半開区間) let range1 = 0..<10 let range2 = 0.0..<10.0 // ClosedRange(閉区間) let closedRange1 = 0...10 let closedRange2 = 0.0...10.0
4 - PartialRange let target = 50 switch target { case 100...: print("greater than 100") case ..<100: print("less than 100") default: print(“default") } // > less than 100
3ʹ͓͚ΔSwift.Range to NSRange let utf16String = string.utf16 let utf16StartPoisition = startIndex.samePosition(in: utf16String) let utf16EndPoisition = endIndex.samePosition(in: utf16String) let distance = utf16StartPoisition.distance(to: utf16EndPoisition) let nsString = string as NSString nsString.substring(with: NSRange(location: 0, length: distance))