Isn't there a substring(start, end)-function????

Timo Virkkala wt at nic.fi
Wed Aug 6 07:55:57 EDT 2003


Dave wrote:
> substring(beginIndex, endIndex) witch returns the substring between
> beginIndex and endIndex.
> 
> Like:
> text = "If someone attacks you with a banana"
> print text.substring(0,3)
> Should print "If "

text = "If someone attacks you with a banana"
print text[0:3]


-- 
Timo Virkkala | wt at nic.fi

   "In the battle between you and the world, bet on the world."





More information about the Python-list mailing list