Click here to Skip to main content
15,794,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to i store a string with 25 characters into an array of [5][5]?
and write the array into a .txt file?

Eg.

store

string haha = "1234567890abcdefghijklmno"

into

array[5][5]= { {12345},
{67890},
{abcde},
{fghij},
{klmno} }

and write it into .txt which looks like:

12345
67890
abcde
fghij
klmno
Posted

Use string.Substring to split up the string, then append each part as a line in a text file. Your concept of a 2D array is a little flawed (just FYI).
 
Share this answer
 
Use split or substring method to break your string in parts. Then use File.WriteAllLines to write them into file.
 
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