swift So entfernen Sie das optionale String-Zeichen

Wie Entferne ich den Optionalen Charakter


let color = colorChoiceSegmentedControl.titleForSegmentAtIndex(colorChoiceSegmentedControl.selectedSegmentIndex)

println(color) //Optional("Red")

let imageURLString = "http://hahaha.com/ha.php?color=\(color)"
println(imageURLString)
//http://hahaha.com/ha.php?color=Optional("Red")

Ich möchte nur die Ausgabe "http://hahaha.com/ha.php?color=Red"

Wie kann ich tun?

hmm....

InformationsquelleAutor der Frage user1272854 | 2014-10-13

Schreibe einen Kommentar