Created
July 18, 2017 01:36
-
-
Save bolenton/03c7df00d9c220433c8932e11b0fa86c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public static string RemoveSpecialSymbols(this string mystring) | |
{ | |
JObject j = new JObject(); | |
j.Add(new JProperty("", mystring)); | |
//string s = j.First.Value<string>(); | |
var sr = new StringWriter(); | |
var jsonWriter = new JsonTextWriter(sr) | |
{ | |
StringEscapeHandling = StringEscapeHandling.EscapeNonAscii | |
}; | |
new JsonSerializer().Serialize(jsonWriter, j[""]); | |
var newString = sr.ToString(); | |
var resultString = Regex.Replace(newString, "\\\"", ""); | |
return resultString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment