After a thorough search, I was able to find how to remove all characters before a particular letter, but not to a letter.
I am trying to rotate a string from this:
" This is a sentence. #contains symbol and whitespace
For this:
This is a sentence.
I tried the following code, but lines, such as the first example, still appear.
for ch in ['\"', '[', ']', '*', '_', '-']:
if ch in sen1:
sen1 = sen1.replace(ch,"")
This will not only not remove the double quote in the example for some unknown reason, but will also not work to remove the leading space, as it will remove all spaces.
Thanks in advance.
Chris source
share