Patrick Cunningham23565
2 discussion posts
I'm trying to make a macro so that each of these words that would be located in my clipboard would be put into a list with spaces and commas, then output back to the clipboard. I'm not sure I need the first and last lines. I cant seem to get it to run. What am I missing?
string Text = Clipboard.GetText();
List<string> words = new List<string> { "blue", "green", "chair" };
Join IEnumerable<string> foundWords = words.Where(i => Text.Contains(i));
string result = string.Join(", ", foundWords);
Clipboard.SetText(result);
if the clipboard only contained one or all three thats what the clipboard would be replaced with. I would be adding a ton of words to search and would like them output in the order they are searched for, without duplicates.
Patrick Cunningham23565
2 discussion posts
Sorry I never got a notification that this was responded to, thanks a ton for helping out!