2

I want to declare a variable of type string, as mentioned in question both ways work. Want to know the difference when to use each one specifically

var testID = String() 
var testID : String = ""
MacDeveloper
  • 1,334
  • 3
  • 16
  • 49
  • There is no difference – iOSDev Feb 05 '20 at 08:59
  • 4
    Does this answer your question? [Swift string via string literal vs initializer](https://stackoverflow.com/questions/31197008/swift-string-via-string-literal-vs-initializer) – iOSDev Feb 05 '20 at 09:00

0 Answers0