Search

// write a program in java which finds the index of a particular character the string.


CODE

import java.io.*;
import java.awt.*;
public class StringIndex
{
public static void main(String args[])
{
String s = "Welcome to BCA";
System.out.println(s);
System.out.println("INDEX OF 'B' IN THE STRING IS=" + s.indexOf("BCA"));
}


OUTPUT DISPLAY







Share this article :
 

Post a Comment

 
Support : everytricks4.blogspot.in/ | Johny Template | Mas Template
Copyright © 2011. Computer Tricks - All Rights Reserved
Creating Website Published by
Proudly powered by Blogger