Extracting the RGB value from a string
问题 How would I extract the RBG value from the following string?: let string = "<span style=\"background-color: rgb(230, 0, 0);\"> I would like to get extract "rgb(230, 0, 0)" from the background-color value, so I can convert it to a hex string and update some UI. let range = string.range(of: "\"background-color: ") let startPoint = range.location + range.length let subString = string.substring(from: startPoint) //generating error claiming 'cannot convert value of type 'int' to expected argument