remove last word in label split by \
c#, split
Solution
How do you get this string in the first place? I assume you know that '' is the escape character in C#. However, you should get far by using
name = name.TrimEnd('\\').Remove(name.LastIndexOf('\\') + 1);
Problem
Ok i have a string where i want to remove the last word split by \ for example: ``` string name ="kak\kdk\dd\ddew\cxz\" ``` now i want to remove the last word so that i get a new value for name as ``` name= "kak\kdk\dd\ddew\" ``` is there an easy way to do this thanks