What is the best (fastest) way to strip new line characters from a string in Python? In C I would do: char *p; p = strchr(str, '\n'); if(p) *p = '\0'; /* repeat process for '\r' character */ Thanks.