I want to remove a backslash character from this string:
String result = "[{\"venues\":{\"venueId\":1,\"name\":\"First Venue\","
+ "\"telephone\":\"jkljl\",\"description\":\"Edited Description\","
+ "\"address\":\"jlkjlj\",\"city\":\"lkjl\",\"postcode\":\"M221TX\","
+ "\"image\":z\"abcImage007.jpg\",\"latitude\":53.37655,\"longitude\":-2.27418,\"deleted\":0,"
+ "\"events\":[{\"eventId\":3,\"name\":\"Test Event\",\"description\":\"Test Event Description\",\"date\":\"24/07/2011\",\"startTime\":\"11:11\",\"venueId\":0,\"deleted\":1},"
+ "{\"eventId\":3,\"name\":\"Test Event\",\"description\":\"Test Event Description\",\"date\":\"25/07/2011\",\"startTime\":\"11:11\",\"venueId\":0,\"deleted\":1}]}}]";
I have tried:
String abc = result.Replace(@"\",@"");
String abc = result.Replace(@"\",string.Empty);
String abc = result.Replace(@"\\",@"");
String abc = result.Replace(@"\\",string.Empty);
But nothing is working. Could someone help please.
Thanks
Your string doesn't contain \
you dont need to remove them. \" is escape sequence that shows that in your string is " symbol(quotation mark)
More fully:
Your string doesn't contain the \ character. In the variable declaration it is used to escape the " character so that it can be put into the string without causing the end of the string to occur.
If write out the value of the variable somewhere you'll find there are no \ characters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With