How to convert UInt8 byte array to string in Swift

前端 未结 14 2550
野的像风
野的像风 2020-12-05 06:29

I am facing problems while converting UInt8 Byte array to string in swift. I have searched and find a simple solution

String.stringWithBytes(buf         


        
14条回答
  •  长情又很酷
    2020-12-05 07:05

    Swift 4 / Ubuntu 16.04

    let serverAns = [UInt8](repeating: 0x50, count: 100)
    let readBytes = 8
    let truncatedServerAns = serverAns[0..

提交回复
热议问题