Swift- Using String with ternary Operator | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Swift- Using String with ternary Operator

Why cant i use a string in an ternary Operator like this: username == "Admin"? print("Hello, Admin") : print("Hello, Stranger!") or better.. how can i fix it? -z77

15th Jul 2019, 5:32 AM
z77
1 Answer
0
You may just need a space in between “Admin” and ?
8th Sep 2019, 10:37 PM
Benjamin