How can i achieve the string in li's


#1

I have a string s=Rahul Gandhi, congress, general elections2019, tamilnadu;

Now i want to dispay the above string as shown below

FireShot%20Capture%20029%20-%20Demo%20-%20

How can i achieve this ?


#2

Ask future questions like this on https://stackoverflow.com/

To answer your question though, you would do:

string s = "Rahul Gandhi, congress, general elections2019, tamilnadu";
var values = s.Split(',');
for (int i = 0; i != values.Length; ++i)
{
    values[i] = values[i].Trim();
}

.NET Foundation Website | Blog | Projects | Code of Conduct