Swift .uppercaseString or .lowercaseString property replacement

前端 未结 5 1411
青春惊慌失措
青春惊慌失措 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:06

    Heres the function from Apple Docs for Xcode8/Swift3:

    /// Returns a lowercase version of the string.
    ///
    /// Here's an example of transforming a string to all lowercase letters.
    ///
    ///     let cafe = "Café 

提交回复
热议问题