Java String valueOf(char[] data, int offset, int count) Example
String class valueOf(char[] data, int offset, int count) method example
String class valueOf(char[] data, int offset, int count)method example. This example shows you how to use this method.This method Returns the string representation of a specific subarray of the char array argument.
Here is the code:-
/**
* @(#) ValueOf9string.java
*Program that Returns the string representation of a specific subarray of the char array argument.
* @Version 01-May-2008
* @author Rose India Team
*/
public class ValueOf9string
{
public static void main(String args[])
{
//creating a new array
char[] arr = new char[] { 'R', 'O', 'S','E' };
//Returns the string representation of a specific subarray of the char array argument.
String str = String.valueOf(arr, 1,2 );
System.out.println(str);
}
} |
null
|