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!
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
Taylor Quinn20,003 Points
For the method on a string that compares it to another string is the method .equals?
I have been using .equals for the question but have not been getting it right. What am i doing wrong?
Christopher Augg21,223 Points
The question is not asking you to compare the Strings. You would use .equals if that were the case. However, it asks the following:
"Which method on String will allow you to check if a String is part of another."
String someWords = "These are words";
Do you recall what to use to see if a String contains another String? i.e. Does someWords contain "words"?
Please let me know if this helps.
Can someone explain the method of contains stands for? I Haven't seen its introduction in earlier videos or might just skipped that.
i didn't see this either.