tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 
 Tools and Libs > Jodd > Strings > String last index ignorecase

String last index ignorecase 

Jodd is an open-source java library with lot of reusable components and feature rich utilities. This requires the library jodd-3.3.2.jar to be in classpath. The following example shows how to use StringUtil.lastIndexOfIgnoreCase() API. It returns the last index of substring in the given string irrespective of the case.

File Name  :  
com/bethecoder/tutorials/jodd/utils/StringLastIndexIgnorecaseTest.java 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
   
package com.bethecoder.tutorials.jodd.utils;

import jodd.util.StringUtil;

public class StringLastIndexIgnorecaseTest {

  /**
   @param args
   */
  public static void main(String[] args) {
    System.out.println(StringUtil.lastIndexOfIgnoreCase("cdcbcdabcd""Cd"));
    System.out.println(StringUtil.lastIndexOfIgnoreCase("abcd""BcD"));
    System.out.println(StringUtil.lastIndexOfIgnoreCase("xyzyxyzxyxzyx""ZY"));
    System.out.println(StringUtil.lastIndexOfIgnoreCase("abcd""ac"));
  }

}
   

It gives the following output,
8
1
10
-1


                    Print

   



Books Recommendation

 
 
bl  br