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

Java

Thomas Salai
Thomas Salai
4,964 Points

In 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

Hi 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
Thomas Salai
4,964 Points

Thanks.

When I wrote the method in IntelliJ IDE, I got "Cannot resolve symbol "toLowerCase' error.

Yes, you would; apologies. It is a method so requires parentheses after it: .toLowerCase()

Steve.

Thomas Salai
Thomas Salai
4,964 Points

oh...oh.. yes. I overlooked that parentheses for that method .toLowerCase().

Thanks. Cheers,

No problem! :+1: :+1: