Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get string until character python

s = "first_second"
s.split('_')[0] # Split the string on '_' return the first part. 
>>> 'first'
Comment

PREVIOUS NEXT
Code Example
Python :: check strings last letter python 
Python :: how to hide a turtle in turtle python 
Python :: python ascii code to string 
Python :: get user ip address django 
Python :: collections counter 
Python :: python detect lines 
Python :: how to print python 
Python :: python os.name mac 
Python :: pre commit python 
Python :: sum of all multiples of 3 and 5 below 100 
Python :: cv2.threshold binary 
Python :: print column in 2d numpy array 
Python :: Inconsistent use of tabs and spaces in indentationPylance 
Python :: video streaming flask 
Python :: python calculate angle between two points 
Python :: python palindrome 
Python :: how to get elasticsearch index list using python 
Python :: how to play a video in tkinter window 
Python :: django permission required 
Python :: round down a number python 
Python :: take the first in dataloader pytorch 
Python :: stack data horizontally pandas 
Python :: how to convert days into seconds in python using time.time() 
Python :: what should you call a decimal value in python 
Python :: imblearn randomoversampler 
Python :: how to add an item to a list in python 
Python :: how to read then overwrite a file with python 
Python :: how to use the print function in python 
Python :: subsetting based on column value with list 
Python :: Reverse an string Using Recursion in Python 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =