How can I replace all the '' chars in a string into '/' with C#? For example, I need to make @"c:/abc/def" from @"c:abcdef".
See Question&Answers more detail:osHow can I replace all the '' chars in a string into '/' with C#? For example, I need to make @"c:/abc/def" from @"c:abcdef".
See Question&Answers more detail:osThe Replace function seems suitable:
string input = @"c:abcdef";
string result = input.Replace(@"", "/");
And be careful with a common gotcha:
Due to string immutability in .NET this function doesn't modify the string instance you are invoking it on => it returns the result.