I have an array of string like this
[u'ROWKEY\ufffdACCOUNTID\ufffdACCOUNTIDDSC']
How do i convert the above list into the below array list in python
['ROWKEY','ACCOUNTID','ACCOUNTIDDSC']
You should encode your string not decode. Your provided list (array of string as you mentioned) consists of a unicode sting. To represent a unicode string as a string of bytes is known as encoding, use u'...'.encode(encoding). Then by using string.split() you can break that encoded string down into smaller chunks, or strings.
lst = [u'ROWKEY\ufffdACCOUNTID\ufffdACCOUNTIDDSC']
new_list = [i.encode('utf8') for i in lst[0].split(u'\ufffd')]
print(new_list)
Output would be:
['ROWKEY', 'ACCOUNTID', 'ACCOUNTIDDSC']