I have a HashSet<string> that is added to periodically. What I want to do is to cast the entire HashSet to a string without doing a foreach loop. Does anybody have an example?
I have a HashSet<string> that is added to periodically. What I want to do
Share
You will loop over the contents, whether you explicitly write one or not.
However, to do it without the explicit writing, and if by “cast” you mean “concatenate”, you would write something like this