Swift .uppercaseString or .lowercaseString property replacement

前端 未结 5 1348
青春惊慌失措
青春惊慌失措 2021-02-01 12:39

Since Strings in Swift no longer have the .uppercaseString or .lowercaseString properties available, how would i go about performing that function?

If i have for example

5条回答
  •  北海茫月
    2021-02-01 13:11

    The uppercaseString and lowercaseString properties on String are not in the Swift standard library anymore. Instead, Foundation provides them now. So you have to

    import Foundation
    

    to use it.

提交回复
热议问题