1:52 am - Saturday December 15, 2018

String Example Program for lastIndexOf(int ch)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
@AUTHOR: candid java
@DESCRIPTION: coding for  find the index of the specified character.
*/

public class LastIndexOfCh
 {
  public static void main(String args[])
   {
    String s ="Application based software";
    System.out.println(s);
    System.out.println("lastIndexOf(a)=" + s.lastIndexOf(97));//return the index of character a
    System.out.println("lastIndexOf(b)=" + s.lastIndexOf('b'));//return the index of character b
   }
 }

OUTPUT:
Application based software
lastIndexOf(a)=23
lastIndexOf(b)=12

BACK

Filed in: Z-A All Java Codes

Comments are closed.