+ 2

Swift

let myPoint = (1, -1) switch myPoint { case let (x, y) where x == y: print("(\(x), \(y)) is on the line x == y") case let (x, y) where x == -y: print("(\(x), \(y)) is on the line x == -y") case let (x, y): print("(\(x), \(y)) is just some arbitrary point") } In this program what does \x and \y do or mean exactly . Pls reply fast i really am confused Thank you so much

14th Jul 2019, 2:42 PM
Svojas Pitale
Svojas Pitale - avatar
1 Réponse
+ 3
\(x) and \(y) allow you to insert the value of x and y into a string.
15th Jul 2019, 11:39 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar