String array to notepad
Take a look at
If I understand you correctly, you just want to write to a text file.
-
You will need to iterate over your string array and then write the contents of each index to the string array on a new line in the file.
-
Remember to properly remove the writer when finished.
If you need more information, please let me know and I'll post an example, but I think it's worth getting involved first and see how you do it :)
a source to share
string filepath = "some_path_in_here";
string filename = "test.txt";
StreamWriter sw = new StreamWriter(fileName, false);
for(int i = 0; i < strings_array.Count; i++)
{
sw.Write(strings_array[i]);
sw.Write(sw.NewLine);
}
try this, but you better read some book to do simple things like this. Don't expect others to give you an exact solution.
a source to share
You can use StringBuilder to concatenate strings to each other (if you just want to put each string on a new line):
StringBuilder sb=new StringBuilder();
foreach(string line in lines)
{
sb.AppendLine(line);
}
return sb.ToString();
Since the string is an immutable object (if it changed a new instance will be created), it is not recommended to do something like:
line=line+"\n\r";
a source to share