I have a string sequence from the output of an application which prints the control chars in "\x00" method. Example
\x00R50\x00\x00\x00\x01
I'm converting this to a scala string in REPL by inspecting the char one at a time and adding to a byte array.
scala> val ar:Array[Byte]=Array(0,82,53,48,0,0,1)
ar: Array[Byte] = Array(0, 82, 53, 48, 0, 0, 1)
scala> val a = ar.map(_.toChar).mkString
a: String = ?R50???
scala>
This seems to be laborious.. is there a quick way to convert \x00R50\x00\x00\x00\x01
to the val a
as above?