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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Jamie Baldaro](https://secure.gravatar.com/avatar/d94785bab38d73e153cc39f5119b7a0e?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Jamie Baldaro
15,616 PointsComplete the following code to split the string by spaces into an array of strings.
Please!!! will someone explain to me what i'm doing wrong?
This really shouldn't be this difficult.Split it into an array of strings. I've even tried various solutions to this.
string[] words = "The quick brown fox jumped over the lazy dog".Split(null); string[] words = "The quick brown fox jumped over the lazy dog".Split(new char[0]); string[] words = "The quick brown fox jumped over the lazy dog".Split(' '); string[] words = "The quick brown fox jumped over the lazy dog".line.Split;
Please, could someone just put my mind to rest and give me some idea?
2 Answers
![Craig Fender](https://secure.gravatar.com/avatar/366e1bed1da9267b091e8d5b7f3e5f29?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Craig Fender
7,605 PointsYou need to pass a delimiter character to the Split method. In this case, the delimiter is a space to separate the words, so your third attempt should work as long as there is a space between the apostrophes (' '):
string[] words = "The quick brown fox jumped over the lazy dog".Split(' ');
![Kevin Gates](https://secure.gravatar.com/avatar/e6d902128dd45e6d463bc4f42dee5fcd?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Kevin Gates
15,053 PointsSo the answer is:
Split(' ')
If you put double quotes, it fails. I'm not 100% certain if Split if quote-sensitive (" vs ' ) or if it's the Treehouse parsing logic. Either way, the correct answer is: Split(' ')