[Python Wpg] String to integer conversion

Bill Reid billreid at shaw.ca
Tue Mar 28 18:00:53 EST 2006


Mike Pfaiffer wrote:

> Is there a simple way to check if the value of the string is numeric first or 
> better yet return zero if the value of the string contains alphabetic 
> characters?
> 

I did not look up a reference so there might be a better "python" way of doing 
it but you could using a reg expression match    ^[0-9]*$

-- Bill



More information about the Winnipeg mailing list