Created
June 11, 2014 02:43
-
-
Save cgwxyz/45fc865634473f886e2a to your computer and use it in GitHub Desktop.
python删除字符串slash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stripslashes(s): | |
import re | |
r = re.sub(r"\\(n|r)", "\n", s) | |
r = re.sub(r"\\", "", r) | |
return r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment