I am getting my data from XML which may some time contain special Character at beginning like:
‘This is a sample title or %&*I don’t know if this is the text
I tried with :
title[0].isstring() or title[0].isdigit() and then remove the character. But if there are more than one special character at the beginning, then how do I remove it? Do I need a for loop?
You could use a regular expression:
This removes all non-alphanumeric characters from the start of your string:
Explanation: