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 trialAakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointscharAt()
what is the meaning of this statement? char guess = guessInput.charAt(0); please help me.
3 Answers
ALBERT QERIMI
49,872 Pointsto retrieve just first letter that you get from guess input
Mohammed Yehia
Courses Plus Student 9,255 Pointsany character sequence in java use zero based position so the first is 0 then 1,2,.... so for example
char c = "hello".charAt(0); // c = 'h'
h is 0, e is 1 and so on in counting so we extract the first letter by telling it to give us the letter at the position zero (give us the char at the position number)
ALBERT QERIMI
49,872 PointsYes, in this case, we are checking just for the first letter because one letter for guess that is all we need in this case
Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointsAakash Srivastav
Full Stack JavaScript Techdegree Student 11,638 PointsAre we checking only first letter? plz explain it. I am unable to get it.