SwiftScanner
SwiftScanner copied to clipboard
Fatal error: String index is out of bounds
Hi,
The following code crashes on the last line with a fatal error : String index is out of bounds instead of throwing an error
let scanner = StringScanner("1.0")
try scanner.skip(charactersIn: .whitespaces)
let red = try scanner.scanFloat()
try scanner.skip(charactersIn: .whitespaces)
let green = try scanner.scanFloat()