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

Python: Using string Methods

Python: Using string Methods

__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:

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

No comments yet.

Leave a Comment