fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string nameString = @"C:\Users\Documents\Development\testing\11.0.25.10\W_11052_0_X.pts";
  8. string pathPrefix = Regex.Match(nameString, @"^(.*[\\])").Groups[1].Value;
  9. Console.WriteLine(pathPrefix);
  10. }
  11. }
Success #stdin #stdout 0.07s 34072KB
stdin
Standard input is empty
stdout
C:\Users\Documents\Development\testing\11.0.25.10\