Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

#remove leading and trailing spaces

#Remove leading and trailing spaces
S1 = '   Python rocks   '
print(S1)
print(S1.strip())
print(S1.lstrip())
print(S1.rstrip())
Comment

PREVIOUS NEXT
Code Example
Python :: python console 
Python :: crypto trading bot python 
Python :: python string replace by index 
Python :: seaborn orient 
Python :: python inline if 
Python :: remove punctuation from a string 
Python :: spliting the text to lines and keep the deliminaters python 
Python :: How to shift non nan values up and put nan values down 
Python :: python numpy array subtract 
Python :: python request body json 
Python :: python Using for loop and list comprehension 
Python :: select element using Css selector in python 
Python :: python code for internet radio stream 
Python :: pivot table but keep nan 
Python :: division of 2 numbers in python 
Python :: map function to change type of element in python 
Python :: python string contains substring ignore case 
Python :: select each two elements on a list python 
Python :: truthy falsy python 
Python :: check if string is python 
Python :: numpy.where 
Python :: logger 
Python :: string slice python 
Python :: giving number of letter in python 
Python :: how to normalize scipy cross correlation 
Python :: python check if number contains digit 
Python :: Removing Elements from Python Dictionary Using pop() method 
Python :: how to sort numpy array 
Python :: lambda functions python 
Python :: python multidimensional dictionary 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =