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?

3 of 5 people (60%) answered Yes
Recently 3 of 5 people (60%) 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