java.lang.string.getChars()

getChars() method in Java

getChars() method in Java used to copy the content of the String according to given parameters. The getChars() method takes 4 parameters

1.strBegin
2.strEnd
3.dst and
4.dstBegin

a Simple example...

public static void main(String[] args){
String str = "How are you.";
char[] arr = new char[7];
str.getChars(2, 9, arr, 0);
System.out.print("The Character array equals: ");
System.out.println(arr);
}

the Output is:
The Character array equals: w are y

Description of the getChars() example

Advertisements

Share on Google+Share on Google+

java.lang.string.getChars()

Posted on: March 17, 2005 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

 

Discuss: java.lang.string.getChars()  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads