Newby question - Trimming spaces from a string

Chris Barker chrishbarker at home.net
Fri Jun 8 17:37:14 EDT 2001


Glen Mettler wrote:
>  I had to download "Lib.pdf" from the web
> to find all the object model properties for "String"

You'll find lib.pdf to be invaluable for many, everything.

By the way, with Python 2.0 or 2.1 , you have access to most of the
string functionality, so you don't need to import string, and can just
do:

s = " A sting with spaces  "
s.strip()

This works for .split() an many others...

-Chris



-- 
Christopher Barker,
Ph.D.                                                           
ChrisHBarker at home.net                 ---           ---           ---
http://members.home.net/barkerlohmann ---@@       -----@@       -----@@
                                   ------@@@     ------@@@     ------@@@
Oil Spill Modeling                ------   @    ------   @   ------   @
Water Resources Engineering       -------      ---------     --------    
Coastal and Fluvial Hydrodynamics --------------------------------------
------------------------------------------------------------------------



More information about the Python-list mailing list