Here you can find the source of endsWithIgnoreCase(final String source, final String target)
Parameter | Description |
---|---|
source | string to be tested. |
target | string to be tested. |
public static boolean endsWithIgnoreCase(final String source, final String target)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w ww . j a v a 2 s . c o m*/ * Returns true if given source string end with target string ignore case * sensitive; false otherwise. * * @param source string to be tested. * @param target string to be tested. * @return true if given source string end with target string ignore case * sensitive; false otherwise. */ public static boolean endsWithIgnoreCase(final String source, final String target) { if (source.endsWith(target)) { return true; } if (source.length() < target.length()) { return false; } return source.substring(source.length() - target.length()).equalsIgnoreCase(target); } }