Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

String indexOf() Method

                         

In this section, you will get the detailed explanation about the indexOf() method of String class. We are going to use indexOf() method of String class in Java. The description of the code is given below for the usage of the method.

Description of the code:

Here, you will get to know about the indexOf() method through the following java program. In the program code given below, we have taken a String. To find the index of any character we have applied indexOf(); method and then we have passed the character in that to find its index as shown in the output.

The code of the program is given below: 

public class stringDemo{
  public static void main(String[] argsthrows Exception{
    String color = "bluegrey";
    int index = color.indexOf('e')
    System.out.println(index);
  }
}

Output of the program:

C:\unique>javac stringDemo.java

C:\unique>java stringDemo
3

C:\unique>

Download this example.

 

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

4 comments so far (
post your own) View All Comments Latest 10 Comments:

in util package i have so many doubts.by using this i can able to clear some of my doubts

Posted by kumaran on Saturday, 10.11.08 @ 18:19pm | #81018

may I ask some specific questions?do you know the string class method?and their examples?just lyk ex."index method"....can you please give me the answers of my question?thanks .....

Posted by LJ on Sunday, 09.21.08 @ 11:34am | #80576

anyone can easily understand this. very superb

Posted by rathidevi on Monday, 08.25.08 @ 11:59am | #74977

how to read text document and only display string inside the bracket only.

Posted by dYeeLa on Wednesday, 05.14.08 @ 07:30am | #59760

Latest Searches:
json lib//components/c
multithreading servlet
ShortestJobFirst
pseudocode of magic sq
struts 1 date picker e
Photoshop Drawing Draw
Time
ร?ฦ?ร?ย�ร?
struts-config.xml
registeremailaddresswi
text area
sybase create command
passingdynamicparamete
struts1.3
scrolling text banner
cache
struts plugins for mye
java Game manager
slf4j
tell me about yourself
html:select jsp
bean
real time in java
scrolling system tray
process.jsp
tree view
give me some java pro
blazeds
struts2 checkbox
sendingfax
insertdatatotextfileus
java jtable
scrolling text
javascript save data
insert + executeupdate
tomcat database conf
PHP Database Related O
How to insert multiple
Easy
insert +executeupdate+
gettersettermethods
getter setter methods
struts1 tutorials for
tuxedo
j2me game
example for adding the
image on title bar sou
accessing ms acces
?ร??รà¸???ร?ยà
Action Class in struts
add the ArrayList to
seam tutorial
add two strings
checkbox in jsp
download
count row in resultset
swings ioc
Treemapusinggwttree
Convert float to biner
servlet to jsp
how to upload image ur
text box character val
Html tutorial
Flash Animation Tweene
mysql-connector-java-3
httpRequest
springtutorial
prime numbers between
phoneformate
file oracle jsp
MurachÑ??Ð?аÐ???Ñ??Ð?
java date compare exam
digital numbers recogn
Cape Clear Orchestrato
coding of radio button
LAMJ
Combattons la programm
appendingtoafilejava
NetBeans IDE
Building a Simple EJB
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.