【发布时间】:2022-01-16 23:43:20
【问题描述】:
我是 C# 新手,需要帮助格式化此代码,我尝试从剪贴板读取特定单词,然后将其输出回剪贴板。我需要在字符串列表搜索中添加无穷无尽的数字或单词。
Text = Clipboard.GetText();
string Text = "Text to analyze for words, chair, table";
List<string> words = new List<string> { "chair", "table", "desk" };
var result = words.Where(i => Text.Contains(i)).ToList();
TextOut = Clipboard.SetText();
\\outputs “chair, table” to the clipboard
【问题讨论】:
标签: c# list clipboard contains