Another discovery today, courtesy of Google finding Rik Robinson's Blog is String.TrimStart() and String.TrimEnd().
To trim a leading slash of a string or path use:
myString = myString.TrimStart(new char[]{'\\', '/'});
To trim a trailing slash of a string or path use:
myString = myString.TrimEnd(new char[]{'\\', '/'});
I had previously been using a much more long-winded approach. Cheers Rik for bringing that to my attention.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.