How do I convert string to uint8?

4,088 views
Skip to first unread message

Athiwat Chunlakhan

unread,
Jun 30, 2011, 12:10:38 PM6/30/11
to golan...@googlegroups.com
I'm confused. Right now I'm using "html" package which works very well even it says INCOMPLETE.

The problem here is the package returns an slice of uint8, I can convert it to a string using "string([]uint8 here" but how do I convert it back???

-- 
Athiwat Chunlakhan

Seth Hoenig

unread,
Jun 30, 2011, 12:16:58 PM6/30/11
to golang-nuts
[]uint8("the_string_here")


On Jun 30, 11:10 am, Athiwat Chunlakhan <athiw...@googlemail.com>
wrote:

Vida

unread,
Jun 30, 2011, 12:18:57 PM6/30/11
to golang-nuts
Oh wow, +-+ I guess I'm just stupid for using "uint8" only.

Thanks you.

Jan Mercl

unread,
Jun 30, 2011, 12:22:00 PM6/30/11
to golan...@googlegroups.com
On Thursday, June 30, 2011 6:10:38 PM UTC+2, Athiwat Chunlakhan wrote:
The problem here is the package returns an slice of uint8, I can convert it to a string using "string([]uint8 here" but how do I convert it back???

HTH 
Reply all
Reply to author
Forward
0 new messages