Generate a String representing specific characters from a char array.
char[] |
The copyValueOf() method yields a String representing the characters contained within a char array.
This function creates a fresh String array and duplicates the characters into it.
public |
Parameter |
Description |
data |
A char array |
offset |
An integer value indicating the starting index of the character array. |
count |
An integer value representing the length of the character array. |
returns |
A string representing the characters of the character array. |
Throws |
StringIndexOutOfBoundsException occurs if the offset is negative or out of range, or if the count exceeds the length of the character array, or if it’s negative. |