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 trialStephanie Fu
1,939 PointsWhy use toString()?
At around 05:40, toString() is used. Can you also cast the Editable to a String like we did in previous lessons? Or does that not work for strings?
1 Answer
J A
Full Stack JavaScript Techdegree Student 4,646 PointsThe getText() method does not return a String, but an editable type. That object needs to be converted to a String in order to be stored in the name variable.
Ham Hamey
5,712 PointsHam Hamey
5,712 PointsIt doesn't toString method is used to get a suitable string format from the edittext string for more info reffer example link