![]() endsWith(String suffix) method internally uses startsWith(String prefix, int offset) method to find the result.endsWith(String suffix) method throws the error “incompatible types” when the suffix variable is passed as a character or a numeric data type and not a string data type.It will throw IndexOutOfBoundsException if startIndex is negative or larger than the length of this String object. endsWith(String suffix) method throws NullPointerException when the suffix string is null. public String substring (int startIndex): Returns a new string which start from a specified string and extends to the end of this string.If the string ends with a given suffix, the endsWith(String suffix) method returns true else false. ![]() You will need to start by creating a string before you can do anything with the substring method.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |