Horje
python string: .strip() Code Example
python string: .strip()
# Мөрний эхэн ба төгсгөлийн тэмдэгтүүдийг арилгахын тулд .strip() аргыг ашиглаж болно.
# Мөрийн аргументыг арга руу дамжуулж, арилгах тэмдэгтүүдийн багцыг зааж өгч болно.
# Аргын аргумент байхгүй бол хоосон зай арилна.

text1 = '   apples and oranges   '
text1.strip()       # => 'apples and oranges'
 
text2 = '...+...lemons and limes...-...'
 
# Here we strip just the "." characters
text2.strip('.')    # => '+...lemons and limes...-'
 
# Here we strip both "." and "+" characters
text2.strip('.+')   # => 'lemons and limes...-'
 
# Here we strip ".", "+", and "-" characters
text2.strip('.+-')  # => 'lemons and limes'




Python

Related
Python How to make your application check for updates Code Example Python How to make your application check for updates Code Example
testdata['time'].dt.tz_localize(None) Code Example testdata['time'].dt.tz_localize(None) Code Example
docker opencv python libGL.so.1: cannot open shared object file: No such file or directory Code Example docker opencv python libGL.so.1: cannot open shared object file: No such file or directory Code Example
pyqt5 date-edity Code Example pyqt5 date-edity Code Example
replace NaN value in pandas data frame Code Example replace NaN value in pandas data frame Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7