simple form of parsing)perform case conversionstest the content of the string (digitslettersand so on)and strip whitespace characters off the ends of the stringline 'aaa,bbb,ccccc,ddline split(','['aaa''bbb''ccccc''dd' 'spams upper('spams isalpha(true split on delimiter into list of substrings upperand lowercase conversions content testsisalphaisdigitetc line 'aaa,bbb,ccccc,dd\nline rstrip(remove whitespace characters on the right side 'aaa,bbb,ccccc,ddline rstrip(split(','combine two operations ['aaa''bbb''ccccc''dd'notice the last command here--it strips before it splits because python runs from left to rightmaking temporary result along the way strings also support an advanced substitution operation known as formattingavailable as both an expression (the originaland string method call (new as of and )the second of these allows you to omit relative argument value numbers as of and '%seggsand % ('spam''spam!''spameggsand spam!formatting expression (all'{ }eggsand { }format('spam''spam!''spameggsand spam!formatting method ( + +'{}eggsand {}format('spam''spam!''spameggsand spam!numbers optional ( + +formatting is rich with featureswhich we'll postpone discussing until later in this bookand which tend to matter most when you must generate numeric reports'{: }format( ' , ' %+ ( - ' - separatorsdecimal digits digitspaddingsigns one note herealthough sequence operations are genericmethods are not--although some types share some method namesstring method operations generally work only on stringsand nothing else as rule of thumbpython' toolset is layeredgeneric operations that span multiple types show up as built-in functions or expressions ( len( ) [ ])but type-specific operations are method calls ( astring upper()finding the tools you need among all these categories will become more natural as you use python morebut the next section gives few tips you can use right now strings