In: Computer Science
how do I split this string in python??
testString="\0xdc\0x02\0xfe\0x7d\0xac"
I want it to be recognized as having a data length of 5 and for the first value to be 0xdc, second one to be 0x02 and so on...
#source code:
these code for capital letter O if string contain
testString="\Oxdc\Ox02\Oxfe\Ox7d\Oxac"
data=testString.split('\\')
output=data[1:6]
print(output)
#this code for digit 0 contain in the string
source code:
testString="\0xdc\0x02\0xfe\0x7d\0xac"
data=testString.split('\0')
output=data[1:6]
data_final=[]
for i in output:
val=str(0)+i
data_final.append(val)
print(data_final)
#if you have any doubt comment below....