Pages

Saturday 28 May 2011

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

0 comments
 

// 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





Leave a Reply