Salaam
I am looking for a proper version of a C# or Razor equivalent of PHP's addSlashes
. That would add
\
to some\string
=> some\\string
Please provide help
Why I needed this
In my application a user entered Sometext in textbox
was accidently pressed next time when page when data was populated though Razor it was like this
...append('<span>'+'@Model.value'+'</span>')
=> after compiling it becomes like this
...append('<span>'+'sometext\'+'</span>')
so with this scenario my javascript code broke at '\' because now single quote has started but not ending due to ``. So i thought instead of limiting characters i would rather add slashes through C# code
Thank You