I am having troubles removing backslash from my string.
The string is like this “3adsadas34\”.
I want to remove the backslash at the end, I tried with:
urlContent = realUrl.Remove(realUrl.Length - 1, 1);
But it doesn’t want to work.
I would like to know if I can use regex, and if I can, maybe someone can provide regex sample for removing ‘\’ from that string, or some other way to remove the backslash is more then welcome.
Thanks in advance, Laziale
Try this
Note: You have to escape the backslash.
Your
Removecode looks OK.realUrl.Substring(0, realUrl.Length-1)would do the same. The problem might be somewhere else.