Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99157

How do you store a char[] array into a text file in c# (Using System.IO) .NET? [duplicate]

$
0
0

This question already has an answer here:

How can I store the contents of a char array into a text file in C# with .NET? I have tried

char[] characters = VarInput.ToCharArray();
System.IO.File.WriteAllText(@"C:\Users\leoga\Documents\Projects_Atom\Pad_Wood\WriteText2CharacterArray.txt", characters);

but it comes up with an error message saying

Argument 2: cannot convert from 'char[]' to 'string'
[C:\Users\leoga\Documents\Projects_Atom\Pad_Wood\converter.csproj]

I have also tried it with File.WriteAllLines() but it still doesn't work. I am using c# and .NET


Viewing all articles
Browse latest Browse all 99157

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>