Value of type 'String' has no member 'stringByTrimmingCharactersInSet'

前端 未结 4 678
無奈伤痛
無奈伤痛 2020-12-11 00:12

After converting my project to swift 3, I get the following Value of type \'String\' has no member \'stringByTrimmingCharactersInSet\' error on the first line w

4条回答
  •  伪装坚强ぢ
    2020-12-11 01:07

    You can try this as well.

    let trimmedString = hex.trimmingCharacters(in: CharacterSet.whitespaces)
    

提交回复
热议问题