How do I get the string before a certain character in swift? The code below is how I did it in Objective C, but can\'t seem to perform the same task in Swift. Any tips or su
let string = "Hello-world" if let range = string.range(of: "-") { let firstPart = string[(string.startIndex)..
Output is: Hello