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 Start with Example

                         

In this section, you will learn how to check the given string that start from the specified character in java. The following program checks the started string with "Wel". If  you  use startsWith() function it will return 'true' and display a message "The given string is start with Wel" otherwise it will show "The given string is not start with Wel". 

Description of code:

startsWith(String start):
This is a Boolean type method that returns either 'true' or 'false'. It checks the given string that begins with specified string in the beginning. It takes a string type parameter such as:

        start: This is the string that starts.

Here is the code of program:

import java.lang.*;

public class StrStartWith{
  public static void main(String[] args) {
    System.out.println("String start with example!");
    String str = "Welcome to RoseIndia";
    String start = "Wel";
    System.out.println("Given String : " + str);
    System.out.println("Start with : " + start);
    if (str.startsWith(start)){
      System.out.println("The given string is start with Wel");
    }
    else{
      System.out.println("The given string is not start with Wel");
    }
  }
}

Download this example.

Output of program:

C:\vinod\Math_package>javac StrStartWith.java

C:\vinod\Math_package>java StrStartWith
String start with example!
Given String : Welcome to RoseIndia
Start with : Wel
The given string is start with Wel

                         

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 
Latest Searches:
make programs
DOJO
Inserting data from gu
Java example program t
date month year day
finding max min array
using jacob.jar in jsp
how to read key value
file chooser
Eclipse SDE
panelGrid/
Second-generation aspe
java set methods
java arrays
Java Read File Line by
input values from cmd
text_io.file_type
JMF
.setDocument(new
select a row in jsp
max length 500 chars
Photoshop Christmas Ba
analog
modified
HQL find
Photoshop Textures and
jsf action form
popup in jsp
how to edit a any file
PHP Creating a Mail Fo
jstl basics tomcat
Get average in Array
Date
two date picker diff
excel from java
Add listener to compon
load file
java thread
Eclipse 3.4 EJB
shell
mysql blob
jstl list size
refid in sql select st
how to read xml file i
FileInputStream
hibernate connection p
add a list box in a fo
Logger
JFrame.extendedState
reads data into text f
string array add eleme
JSP delete records in
Use of <fn:substringBe
request.setAttribute(H
Insert an array list o
objective type questio
pagination javascrip
java array keep input
Web Site promotion ser
JTable
Applet in Eclipse - Ru
flex combo box
value change listener
servlet
how to run a servlet f
How to get data from d
covert uppercase to lo
drill down using jfree
getting integer input
Color
array java
We are providing Linux
JScrollPane
jsp with strutsframewo
add picture to a swing
xml parser
hibernate one-to-one
set cell value JTable
sum
Integer.parseInt examp
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.