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

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
Studyopedia Editorial Staff
[email protected]

We work to create free tutorials for all.

No Comments

Post A Comment