I am doing this in Playground, but I am not getting any error. Am I not recreating constant range
? Is it happening in 2 different scopes? What's happening in the background that makes this not an error?
if let range = add1.rangeOfString(", ") {
print(add1.substringToIndex(range.startIndex))
print (range)
}
if let range = add1.rangeOfString(", ") {
print(add1.substringToIndex(range.startIndex))
print (range)
}