Buzz Code
Published in

Buzz Code

Java 8 | String Method 3

Following from the last time, let’s see what kind of methods we can use on the String.

(1) trim()

This method removes the spaces in the beginning and the end of the String. It doesn’t need parameter.

(2) concat()

It puts two String into one.

(3) replaceFirst()

It’s similar with the replace() method, but it only changes the first letters that are same with the String parameter.

(4) equalsIgnoreCase()

This method is same with the equals() method, but

(5) isEmpty()

This method returns true if the String’s length is 0.

That’s all for today guys, let’s practice the String methods next time! Thank you for reading my post, see ya!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store