Java String Ends With endsWithIgnoreCase(String seq, String suffix)

Here you can find the source of endsWithIgnoreCase(String seq, String suffix)

Description

Tests if this string sequence ends with the specified suffix.

License

Open Source License

Parameter

Parameter Description
seq a parameter
suffix a parameter

Return

true if the character sequence represented by 'suffix' is a suffix of the character sequence represented by 'seq'; false otherwise.

Declaration

public static boolean endsWithIgnoreCase(String seq, String suffix) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2015 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from ww w  . ja v a2 s  . com
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

public class Main {
    /**
     * Tests if this string sequence ends with the specified suffix.  
     * @param seq 
     * @param suffix
     * @return true if the character sequence represented by 'suffix' is a suffix of the character sequence represented by 'seq'; false otherwise. 
     */
    public static boolean endsWithIgnoreCase(String seq, String suffix) {

        return seq.toLowerCase().endsWith(suffix.toLowerCase());
    }
}

Related

  1. endsWithIgnoreCase(String name, Iterable patterns)
  2. endsWithIgnoreCase(String p_sStr, String p_sSubStr)
  3. endsWithIgnoreCase(String s, String suffix)
  4. endsWithIgnoreCase(String s, String suffix)
  5. endsWithIgnoreCase(String s, String w)
  6. endsWithIgnoreCase(String source, String eq)
  7. endsWithIgnoreCase(String str, String suffix)
  8. endsWithIgnoreCase(String str, String suffix)
  9. endsWithIgnoreCase(String str, String suffix)