(New page: <source lang="java"> public static String[] convertObjectArrayToStringArray(Object[] objArray) { int len = objArray.length; String[] strArray = new String[len]; System.arraycopy(obj...)
 
 
Line 1: Line 1:
 
<source lang="java">
 
<source lang="java">
public static String[] convertObjectArrayToStringArray(Object[] objArray) {
+
public static String[] convertObjectArrayToStringArray(Object[] objArray) {
int len = objArray.length;
+
int len = objArray.length;
String[] strArray = new String[len];
+
String[] strArray = new String[len];
System.arraycopy(objArray, 0, strArray, 0, len);
+
System.arraycopy(objArray, 0, strArray, 0, len);
return strArray;
+
return strArray;
}
+
}
 
</source>
 
</source>
 +
 +
 +
[[JavaHowTo|Back to JavaHowTo]]

Latest revision as of 03:57, 23 November 2010

public static String[] convertObjectArrayToStringArray(Object[] objArray) {
	int len = objArray.length;
	String[] strArray = new String[len];
	System.arraycopy(objArray, 0, strArray, 0, len);
	return strArray;
}


Back to JavaHowTo

Alumni Liaison

Ph.D. on Applied Mathematics in Aug 2007. Involved on applications of image super-resolution to electron microscopy

Francisco Blanco-Silva