LoginSignup
8
8

More than 5 years have passed since last update.

swift で Byte Array から文字列に変換する

Posted at

Byte array から NSString への変換

var data: [Byte] = [0x41, 0x42, 0x43]  // "A", "B", "C"

println( NSString(bytes: data, length: data.count, encoding: NSASCIIStringEncoding) )
// output: Optional(ABC)

String への変換の API は無いっぽい。

8
8
8

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8