[Tutor] creating the equivalent of string.strip()
alan.gauld at btinternet.com
Sat Sep 29 09:58:55 CEST 2007
"Christopher Spears" <cspears2002 at yahoo.com> wrote
> I'm not sure how to proceed. My biggest stumbling
> block is how to detect the leading and trailing
Recall str[-1] is the last character
str is the first...
Try using a while loop.
Or maybe two?
And strings have an isspace method...
Author of the Learn to Program web site
More information about the Tutor