Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Common Python String Methods

>>> "PrOgRaMiZ".lower()
'programiz'
>>> "PrOgRaMiZ".upper()
'PROGRAMIZ'
>>> "This will split all words into a list".split()
['This', 'will', 'split', 'all', 'words', 'into', 'a', 'list']
>>> ' '.join(['This', 'will', 'join', 'all', 'words', 'into', 'a', 'string'])
'This will join all words into a string'
>>> 'Happy New Year'.find('ew')
7
>>> 'Happy New Year'.replace('Happy','Brilliant')
'Brilliant New Year'
Comment

PREVIOUS NEXT
Code Example
Python :: selenium webdriver without opening browser 
Python :: generative art python 
Python :: error python 
Python :: Access field values of form django 
Python :: find a character in a string python last 
Python :: seaborn factorplot python 
Python :: how to define number in python 
Python :: tail a log file with python 
Python :: python find oldest and newest date 
Python :: python use math 
Python :: loop through dataframe rows python 
Python :: python screeninfo 
Python :: what is chr function on python 
Python :: stemmer nltk 
Python :: numpy dataframe 
Python :: run multiprocesses on flask 
Python :: Lucky four codechef solution 
Python :: views.py 
Python :: assign multiple columns pandas 
Python :: maximum recursion depth exceeded while calling a Python object 
Python :: how to make a 2d array in python 
Python :: cv2 videowriter python not working 
Python :: try and except in python 
Python :: infinite while loop in python 
Python :: Example of ceil method in python 
Python :: Python Dynamic Create var 
Python :: python read xlsx file 
Python :: django make app 
Python :: how to remove text from plot in python 
Python :: channels_redis 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =