Answers for "remove n t from string python"

16

python removing n from string

line = line.strip('n')
line = line.strip('t')
Posted by: Guest on February-21-2020
2

remove n from string python

a_string = a_string.rstrip("n")
Posted by: Guest on July-01-2020
-1

python remove t

>>> s="abc n t tt t nefg"
>>> ''.join(s.split())
'abcefg'
>>> ''.join(c for c in s if not c.isspace())
'abcefg'

import re

s = 'abc n t tt t nefg'
re.sub(r's', '', s)
=> 'abcefg'
Posted by: Guest on October-31-2020

Python Answers by Framework

Browse Popular Code Answers by Language