var str = "hello, world"
str.utf8.startIndex
var byteArray = [Byte]()
for char in str.utf8{
byteArray += char
}
println(byteArray)
可以参阅Swift官方文档:https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html