Use strip() instead of replace().