How to split the String values with a word in C#




string str="srinivas<br / >nivas <br / >Sri"


Result:


List<string> strNames = str.Split(new[] { "<br />" },StringSplitOptions.None).ToList();



Distincr names:
List<string> strNames = str.Split(new[] { "<br />" },StringSplitOptions.None).Distinct().ToList();

Comments

Popular posts from this blog

Reverse Sentence using c#

How to write Pure java script Program?