On Sun, Jan 28, 2018 at 5:46 AM,  <nasirahamed40...@gmail.com> wrote:
> Hi, I'm a begginer in Python, i have a question...
>
> can we use replace method to do it.
>
> E.g. a='cm_text.data'
>      a.replace('.data', ''), this will return output as 'cm_text'.

Yep! That works too. Be aware, though, that it might replace ".data"
in the middle of the string, too. If you know for sure that that won't
happen, then go for it!

BTW, when you reply to someone else's message, it's best to include a
bit of the original text and then type your reply below it - like I do
in this message. That way, people get enough context to understand
what's going on.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to