C#(asp net mvc) -How to remove escape characters from string in controller or jquery? -


when receive string has special character in controller ajax call, see following behaviour

string actualcontent ="abc\efg"; 

the \ in content received

string contentreceived ="abc\\efg"; 

what best way remove escaping character \ ? either in controller while receiving string or in jquery while post processing this.

so assuming might receiving double slashes 1 time or multiple times here in case, might use replace function replace each , every occurrence of \\ \. help.

string receivedstr= "abc\\efg"; string actualstr = receivedstr.replace("\\", "\"); 

also, if url type string, normal appear way double backslashes. if other kind of string, need work out.

hope helps.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -