如何将数组值复制到记事本中 [英] How to copy array value into notepad
本文介绍了如何将数组值复制到记事本中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将数组值复制到记事本中?
How to copy array value into notepad?
推荐答案
使用Clipboard.SetText方法 [
Use the Clipboard.SetText Method[^] to store the values into clipboard and then it will be available for notepad to be pasted.
string FormatArray<T>(T[] arr){
return string.Join(", ", arr.Select(t => t.ToString()).ToArray());
}
然后,您将得到一个可以复制到记事本中的字符串.
Then you get a string which you can copy into notepad.
作为替代方案,您考虑过将记事本克隆嵌入到您的应用程序中,从而可以完全控制其行为.为此,我创建了一个精确的记事本克隆.您可以在这里找到它: http://www .simplygoodcode.com/2012/04/notepad-clone-in-net-winforms.html [
As an alternative have you considered embedding a notepad clone into your application that way you have full control over how it behaves. I created an exact clone of notepad exactly for that purpose. You can find it here: http://www.simplygoodcode.com/2012/04/notepad-clone-in-net-winforms.html[^]
这篇关于如何将数组值复制到记事本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文