I have the list lst= ["is ", "star,", "the-"] and I want to remove ',', '-' without using re.
I used the below and it works but I wondered if there is something simpler:
words = []
index = 0
length = 0
for char in lst:
for i, c in enumerate(char):
if c.isalpha():
if length == 0:
index = i
length += 1
else:
word = char[index:index + length]
words.append(word)
length = 0
print(words)