String getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) method in Java

The getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) method in Java copies characters from this string into the destination character array.

Syntax

Let us see the syntax,

Parameters

Let us see the parameters,

  • srcBegin− index of the first character in the string to copy
  • srcEnd− index after the last character in the string to copy
  • dst− destination array
  • dstBegin− start offset in the destination array

Example

The following is an example of getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin),

Output

The following is the output,

Java String getchars method

byte[] getBytes(String charsetName)
String hashCode() method in Java
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading