public static string ToJsonString(this string s)
{
return s.Replace(@"\", @"\\") // Escape \
.Replace(@"""", @"\""") // Escape "
.Replace("\n", "\\n") // Escape \n
.Replace("\r", "") // Throw away \r
.Replace("\t", "\\t");
}
This blog is useful to all my friends who are working on the .Net Technology and wants to enhance their skills as well their problem solving ability.
No comments:
Post a Comment