Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
0Activity
0 of .
Results for:
No results containing your search query
P. 1
String Operations in Java

String Operations in Java

Ratings: (0)|Views: 2|Likes:
Published by MITMCA

More info:

Published by: MITMCA on Oct 20, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPTX, PDF, TXT or read online from Scribd
See more
See less

04/28/2012

pdf

text

original

 
1
String Operations in Java
 
2
Introduction
String manipulation is the most common operation performed in Javaprograms. The easiest way to represent a String (a sequence of characters) is by using an array of characters.
Example:
char place[] = new char[4];
place[0] = „J‟;
 
place[1] = „a‟;
 
place[2] = „v‟;
 
place[3] = „a‟;
 
 Although character arrays have the advantage of being able to query their
length, they themselves are too primitive and don‟t support a range of 
common string operations. For example, copying a string, searching forspecific pattern etc.
Recognising the importance and common usage of String manipulation inlarge software projects, Java supports String as one of the fundamentaldata type at the language level. Strings related book keeping operations(e.g., end of string) are handled automatically.
 
3
String Operations in Java
Following are some useful classesthat Java provides for Stringoperations.
String Class
StringBuffer Class

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->