Blogopen sourcePythonTech notes

Python estrarre una stringa prima di un determinato carattere

python programming programmazione da zero python

Un ottimo metodo da Python per estrarre una stringa prima di un determinato carattere:

stringa = "image012345676.jpg"
stringa .split('.')[0] #restituisce image012345676
stringa .split('.')[1] #restituisce jpg

 

Comment here