Search

Check if strings ends with a specified string Java

> String endsWith() method

Description
Check if strings ends with a specified string


String theStr = new String("Hello world");

boolean val = theStr.endsWith( "world" ); //true

SEE ALSO