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

C# C# Streams and Data Processing Reading Data Encoding

Calvin Secrest
Calvin Secrest
24,815 Points

Did 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?

CodeChallenge.cs
var mysteryMessage = new byte[] {89, 0, 97, 0, 121, 0, 33, 0};
var messageContents = source byte[] UnicodeEncoding.Unicode.GetString;

1 Answer

You just have to pass mysteryMessage into the method:

var messageContents = UnicodeEncoding.Unicode.GetString(mysteryMessage);

Calvin Secrest
Calvin Secrest
24,815 Points

Thank you for your post