c# - Replace backslash(\) with empty string -


hi having problem while replacing string have backslash()

string sregex = "2004\01".replace("\\", ""); response.write(sregex); // giving me 20041 

but same when include 2 backslashes giving me output expected

string sregex = "2004\\01".replace("\\", ""); response.write(sregex); // giving me 200401  string sreplace = "2004\01"; string sregex = sreplace.replace("\\", ""); 

so there possibility on come first case? should display same result

\0 null character need use verbatim string compiler treat first back-slash instead of escape sequence

string sregex = @"2004\01".replace("\\", ""); 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -