using System; using System.IO; public class ForgetCode { public static void Main() { string str = @"C:\home\level\one"; string newstr = str.Replace(@"\","/"); Console.WriteLine("Input: "+str); Console.WriteLine("Output: "+newstr); } }
Output: |
---|
Input: C:\home\level\one |
Output: C:/home/level/one |