Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

strip method of str in python

txt = ",,,,,11222.....banana....444"
x = txt.strip(",1432.") 
# Note: all .strip("1,234."), .strip("41,.2") etc will give same result
// so whatever char u wanna strip write it once inside string in any order.
// had there been 3 it would also be stripped
print(x)
// prints banana
txt = ",,,,,11222.3....banana....444"
x = txt.strip(",1425.")
print(x) //prints 3....banana

# NOTE: "   apoo  ".strip() ->if no arg is passed to strip()
#                             then all whitespaces at start
#                             and end of str are stripped
 
PREVIOUS NEXT
Tagged: #strip #method #str #python
ADD COMMENT
Topic
Name
9+8 =