How to make sure the first character of a string is one slash ‘/’ with C#, use the TrimStart function
If you want to make sure the first character of a string is one slash, use the function: public string PrependPath(string path, string firstCharacter) { return firstCharacter + path.TrimStart(firstCharacter.ToCharArray()); } To test the function…