Lets say I have a text string : \"Say Hello to My Little Friend\"
A function should return hex value as:
5361792048656c6c6f20746f204d79204c6974746c6520467269
Swift 4, Swift 3
let hex: String = "ABC".unicodeScalars.filter { $0.isASCII } .map { String(format: "%X", $0.value) } .joined() print(hex) // correctly yields 414243