18.12 - Files Split
18.12 - Files Split
View video
clips
Split is a handy string function that allows you to
separate information.
(0) (1)
C# programming is definitely not fun
The next few exercises will read and split information. The
information is found in files.
Previous reading from files did not need split. Why?
StudentMarks2.txt
separates
via
commas
Exercise:
The next exercise will load values into parallel arrays
It will read the lines in the file and will use split since
values are separated by a space
A size is not specified for the array since the size will
depend on the line to be split
array = myReader.ReadLine().Split(',');
// Explanation of line
Above code is used to read the entire line and split the line.