faqts : Computers : Programming : Languages : Python : Snippets : Strings

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 7 people (57%) answered Yes
Recently 4 of 7 people (57%) answered Yes

Entry

How do I extract a part of a string, e.g. all letters from second to fifth?

Apr 22nd, 2008 00:00
Magnus Bodin, Zadig Babylonian,


Example:

>>> a="kaptencybear"
>>> print a[1:5]
apte