I'm using the following code:
var continousDigitsRange:Range<Int> = Range<Int>(start: 0, end: 0)
Since update to Xcode 7.3 (Swift 2.2) I got the following hint:
'init(start:end:)' is deprecated: it will be removed in Swift 3. Use the '..<' operator.
For me is not clear how to "translate" it correctly with "using the '..<' operator.
The Swift Programming Language (Swift 2.2) - Basic Operators
Also worth noting, to
substringWithRange
a String, you can now useAdding some points with reference to swift 3.0
//Countable Range Example.
let range1 = 0..<5
Countable Closed Range Example
//Range from bounds
//To get the distance from substringRange.
// Below Swift 3.0
//For Swift 3.0
I have always had a function to get the substring range of a string. Here is my updated function for Swift 3:
The function is pretty self explanatory - You pass in a string(fullString), the index of that string where the substring starts(fromIndex) and how big the subString is(subStringSize).
Example:
-> Prints: "Name: Nathaniel"
You should simply write
or if you want to go even simpler
to show bmichotte's answer in full...
this produces this is the middle bit>lo, how are <