Python Strings Reference Card
Python Strings Reference Card
Creating a String
s1="Mahesh";
Printing String
print s1; or pring "Value of S1",s1;
Strings and text processing is very vast field and this reference card is not enough to cover everything. This reference card is just an attempt to help newbies get started with strings and text processing.
String Concatenation
s2="Hello! "; s2+=s1; Or s3=s2+s1;
Swapcase
"This is Demo".swapcase()
Spliting Text
"Break this".split()
Strip Strings
"Break text".rstrip() "*** Title ***".strip('*')
String Conditionals
m="this is another text"; m.endswith('text');
http://onecore.net