Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: Using string Methods

Python: Using string Methods
{filelink=16035}

__author__="sako"
__date__ ="$6 oct. 2003 12:04:24$"
text = "Learning Python OOP"
print "upper", "=>", text.upper() # to upper
print "lower", "=>", text.lower() # to lower
print "split", "=>", text.split() # split string
print "join", "=>", "+".join(text.split())# concatenate
print "replace", "=>", text.replace("Python", "Perl")# replace
print "find", "=>", text.find("Python"), text.find("Perl")
print "count", "=>", text.count("n") # string length

Users who found this page were searching for:

  • re.match() python
  • create icon java programme
  • java calendar time seconds
  • python build xml string
  • check if key exists in referenced hash perl

No comments yet.

Leave a Comment