Search code examples
c#asp.netrepeater

separate text and store in a list to bind in repeater in asp.net


I have a text called Default/css. I want a value Default and css separated by / and store in a list.Later this list is bind in a repeater. I know how to bind in repeater but I don't know how to separate text and store in a list. How to do that?


Solution

  • List<string> list = yourString.Split('/').ToList();
    

    make sure that you're working with at least C# 3.0 ver