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 trialCalvin Secrest
24,815 PointsDid you call the 'UnicodeEncoding.Unicode.GetString' method?
Create a new variable named messageContents and use the UnicodeEncoding.Unicode.GetString method to initialize it with the contents of mysteryMessage.
I'm confused on how to call the method?
var mysteryMessage = new byte[] {89, 0, 97, 0, 121, 0, 33, 0};
var messageContents = source byte[] UnicodeEncoding.Unicode.GetString;
1 Answer
Matt English
15,719 PointsYou just have to pass mysteryMessage into the method:
var messageContents = UnicodeEncoding.Unicode.GetString(mysteryMessage);
Calvin Secrest
24,815 PointsCalvin Secrest
24,815 PointsThank you for your post