Android Utililty Methods Array to String Convert

List of utility methods to do Array to String Convert

Description

The list of methods to do Array to String Convert are organized into topic(s).

Method

StringtoString(long[] iArray)
to String
if (iArray == null) {
    return "NULL";
StringBuilder buffer = new StringBuilder();
buffer.append("[");
for (int i = 0; i < iArray.length; i++) {
    buffer.append(iArray[i]);
    if (i != (iArray.length - 1)) {
...
StringtoString(int[] iArray)
to String
if (iArray == null) {
    return "NULL";
StringBuilder buffer = new StringBuilder();
buffer.append("[");
for (int i = 0; i < iArray.length; i++) {
    buffer.append(iArray[i]);
    if (i != (iArray.length - 1)) {
...
StringtoString(String[] iArray)
to String
if (iArray == null) {
    return "NULL";
StringBuilder buffer = new StringBuilder();
buffer.append("[");
for (int i = 0; i < iArray.length; i++) {
    buffer.append("'").append(iArray[i]).append("'");
    if (i != iArray.length - 1) {
...
StringtoString(String s)
Returns the string, in single quotes, or "NULL".
if (s == null) {
    return "NULL";
} else {
    return new StringBuilder(s.length() + 2).append("'").append(s)
            .append("'").toString();
StringtoString(int[][] iArray)
to String
if (iArray == null) {
    return "NULL";
StringBuilder buffer = new StringBuilder();
buffer.append("[");
for (int i = 0; i < iArray.length; i++) {
    buffer.append("[");
    for (int j = 0; j < iArray[i].length; j++) {
...
StringtoString(long[][] iArray)
to String
if (iArray == null) {
    return "NULL";
StringBuilder buffer = new StringBuilder();
buffer.append("[");
for (int i = 0; i < iArray.length; i++) {
    buffer.append("[");
    for (int j = 0; j < iArray[i].length; j++) {
...
StringtoString(Object[] obj)
to String
if (obj == null) {
    return "NULL";
StringBuilder tmp = new StringBuilder();
tmp.append("[");
for (int i = 0; i < obj.length; i++) {
    tmp.append(obj[i].toString());
    if (i != obj.length - 1) {
...
StringbyteArrayToString(byte[] a)
byte Array To String
int i;
for (i = 0; i < a.length; ++i) {
    if (a[i] == 0) {
        break;
try {
    return new String(a, 0, i, "UTF-8");
...
StringbytetoString(byte[] b)
byteto String
try {
    return new String(b, DEFAULT_CHARSET);
} catch (UnsupportedEncodingException e) {
    e.printStackTrace();
return null;
StringhexToString(byte[] ids)
hex To String
StringBuffer id = new StringBuffer();
for (int i = 0; i < ids.length; i++) {
    char c = (char) (((ids[i] >> 4) & 0x0f) + 0x30);
    id.append(c);
    c = (char) (((ids[i]) & 0x0f) + 0x30);
    id.append(c);
return id.toString();
...