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 trialTroy Noseworthy
201 PointsHow can I get each letter to print on a separate line?
It compiles and returns the full word "cat" but not each letter on a separate line.
using System;
class Program
{
static void Spell()
{
Console.Write("c");
Console.Write("a");
Console.Write("t");
}
static void Main(string[] args)
{
Spell();
}
}
3 Answers
KRIS NIKOLAISEN
54,971 PointsMy bad it should be WriteLine with a capital L
Kevin Gates
15,053 PointsAdd a newline character: "\n"
sometimes it's return and newline like "\r\n"
Also, this: https://docs.microsoft.com/en-us/dotnet/api/system.environment.newline?view=netcore-3.0
Troy Noseworthy
201 PointsThanks Kevin!
KRIS NIKOLAISEN
54,971 PointsOr you could use Console.Writeline as specified in the challenge
Troy Noseworthy
201 Pointserror CS0117: 'Console' does not contain a definition for 'Writeline' [/workdir/workspace.csproj] <-- hence Console.Write.