I have list as:
['t','e','s','t','s','t','r','i','n','g']
How to add null character after each string t
, e
, s
, t
, s
, t
, r
, i
, n
, g
?
I have list as:
['t','e','s','t','s','t','r','i','n','g']
How to add null character after each string t
, e
, s
, t
, s
, t
, r
, i
, n
, g
?
List comprehension.
[c + '\0' for c in S]
But it smells like you want UTF-16LE instead.
u'teststring'.encode('utf-16le')