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 trialRa Bha
2,201 PointsKeep getting errors when compiling favoriteThings.length ..not sure what I'm doing wrong here
I keep getting errors when compiling the favoriteThings.length . I'm not sure where I'm going wrong here. Here's my code:
csharp> string[] favoriteThings = new string[3]{"sunshine", "presents", "babies"
};
csharp> favoriteThings
{ "sunshine", "presents", "babies" }
csharp> favoriteThings.length
(1,17): error CS1061: Type `string[]' does not contain a definition for `length'
and no extension method `length' of type `string[]' could be found. Are you mis
sing an assembly reference?
/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous error
)
Here's my workspace snapshot, though I'm not sure you can view the Exceptions.cs console: link
1 Answer
Stefan Cimander
37,115 PointsHi, try using favoriteThings.Length
(with an uppercase L) instead. C# can be really picky at times... ;)