Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to copy array value into notepad?
Posted
Updated 2-Mar-12 0:39am
v2
Comments
Rajeev Jayaram 2-Mar-12 6:40am    
[Edit] Formatted.
OriginalGriff 2-Mar-12 6:47am    
Sorry, but that doesn't make a lot of sense.
Perhaps if you give us an example of your array, and explain what you want to do with it?
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

Use the Clipboard.SetText Method[^] to store the values into clipboard and then it will be available for notepad to be pasted.
 
Share this answer
 
v2
Comments
dingoxiii66 2-Mar-12 8:17am    
after running my program, I have a value stored in the array public double, I want to use the array as a log file of how to write an array value that existed at public double into notepad?
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.
 
Share this answer
 
Comments
dingoxiii66 2-Mar-12 8:18am    
after running my program, I have a value stored in the array public double, I want to use the array as a log file of how to write an array value that existed at public double into notepad?
BobJanova 2-Mar-12 8:53am    
Format it with a method like this (you can pass a double[]) and then copy it to the clipboard.
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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900