I have a question regarding a string I am reading and the splitting it based on a delimiter and storing it in an list.
I have this input 1.2.3.4. where the . is the delimiter. now when i use the split I get this character "" at the end. What is this character?
for element in data.split('.'):
L.append(element)
print L #prints out ["1","2","3","4",""]
my question is what is the last array element ""? I want to get rid of this element not only in this array but also in the string data.
I tried using element.rstrip(element)
but its not getting rid of it. I think most of my confusion comes from what "" refers to in python.
Ialso tried using L.remove("")
but that does not seem to work.