I have a String that has 2 whitespaces and i would like to only remove the last space in the String and also remove the last text. components(separatedBy: " ") splits test where there is a space which i don't wanna do.
Current Text
let teamName = "Aston Villa -1"
I would like it to be like this
teamName = "Aston Villa"