How to print a string from plist without “Optional”?

前端 未结 6 1779
遥遥无期
遥遥无期 2020-12-10 01:46

I load a value from a dictionary in a plist but when I print it to the console, it prints: Optional(Monday Title) rather than just \"Monday Title\".

How can I get ri

6条回答
  •  执笔经年
    2020-12-10 02:29

    initialize

    Var text: string? = nil
    

    Printing

    print("my string", text! as string)
    

    This will avoid word "optional" before the string.

提交回复
热议问题