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
Thomas Salai
4,964 PointsIn this video we use one method .toLowerCase(), is that our own helper method?
In this video we use one method .toLowerCase(), is that our own helper method?
public String[] getWords(){
return mDescription.toLowerCase.split("[^\\w#@']+");
}
2 Answers
Steve Hunter
57,712 PointsHi Thomas,
The toLowerCase() method is a method of the String class. So it's an inbuilt helper method; i.e. it performs a function that is likely to be required due to the properties of the class. People are likely to want a lower, or upper, case version of any string. Both those methods exist to help with those requirements.
Steve.
Thomas Salai
4,964 Pointsoh...oh.. yes. I overlooked that parentheses for that method .toLowerCase().
Thanks. Cheers,
Steve Hunter
57,712 PointsNo problem!
Thomas Salai
4,964 PointsThomas Salai
4,964 PointsThanks.
When I wrote the method in IntelliJ IDE, I got "Cannot resolve symbol "toLowerCase' error.
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsYes, you would; apologies. It is a method so requires parentheses after it:
.toLowerCase()Steve.