My requirement is to remove leading "#" symbol from hashtags in a text. For example, sentence: I'm feeling #blessed. should transform to I'm feeling blessed.
I have written this function, but I'm sure I can achieve the same with a simpler logic in RegEx.
clean_sentence = ""
space = " "
for token in sentence.split():
if token[0] is '#':
token = token[1:]
clean_sentence += token + space
return clean_sentence
Need help here!!