Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRhett Herring
Courses Plus Student 11,023 PointsVisual Studio redundant array
Visual studio is telling me this: string[] fileLines = fileContents.Split(new char[] {'\r', '\n'});
Is a redundant explicit array... also I never had double line breaks....
2 Answers
Carling Kirk
Treehouse Guest TeacherHi Rhett! Do you have Resharper installed?
Also - the CSV file provided was accidentally stripped of its double line breaks. It has been replaced with a file that will produce double line breaks as in the video - if you'd like to try it again.
William Schultz
2,926 PointsThis question was from 7 months ago for me, and the csv file i just downloaded and used only has \n and does not double line break.
Rhett Herring
Courses Plus Student 11,023 PointsRhett Herring
Courses Plus Student 11,023 PointsI do have ReSharper installed... but running without the array does work fine...
Aaron Selonke
10,323 PointsAaron Selonke
10,323 PointsI don't see the /r sequence in the filecontents..... but strange to me
When I use the split method with /r only as the argument.
string[] fileLines = fileContents.Split(new char[] { '\r' });
the data will separate line by line
Ole Vølund Skov Mortensen
27,842 PointsOle Vølund Skov Mortensen
27,842 PointsI also never had double line breaks.... I'm running Visual Studio 2019 with console core, so maybe that's it? I don't know for sure. however but the double line breaks did not appear as in the given example.