How you chomp in python

Pete Jereb petejereb at yahoo.com
Sat Sep 20 22:57:20 EDT 2003


"Fernando Armenta" <farmenta at pillardata.com> wrote in message news:<mailman.1064022207.30931.python-list at python.org>...
> How you cut off the ^M at the end of a line? rstrip is not working. 
> 
>  
> 
> string.rstrip(build number)
> 


Do you mean the newline character?  If your string variable is named
build_number, then

build_number = build_number.rstrip('/n')

works.  Sorry if this isn't what you meant.  But the format should be
the same.  If you did mean ^M then perhaps a hex or octal
representation?




More information about the Python-list mailing list