Modify the string, remove duplicates

Greetings,

I have a string- Feb, May, Feb, April, May
I want output as- Feb, May, April

In brief, I want only distinct month names in the resultant string. Additionally, I do not want to use if condition.

Please help in achieving this output.

inputString.Split(",").Distinct.ToArray.Join(",")
2 Likes

Please help

String.Join(", “, test.Replace(” “, “”).Split(”,"c).Distinct().ToArray())

1 Like

Thank You…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.