Returns a string representation of the short value array
/*
Copyright 1999 CERN - European Organization for Nuclear Research.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose
is hereby granted without fee, provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear in supporting documentation.
CERN makes no representations about the suitability of this software for any purpose.
It is provided "as is" without expressed or implied warranty.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DiscoveryLogic.Common.Numeric
{
public class Arrays : System.Object
{
/// <summary> Returns a string representation of the specified array. The string
/// representation consists of a list of the arrays's elements, enclosed in square brackets
/// (<tt>"[]"</tt>). Adjacent elements are separated by the characters
/// <tt>", "</tt> (comma and space).
/// </summary>
/// <returns> a string representation of the specified array.
/// </returns>
public static System.String toString(short[] array)
{
System.Text.StringBuilder buf = new System.Text.StringBuilder();
buf.Append("[");
int maxIndex = array.Length - 1;
for (int i = 0; i <= maxIndex; i++)
{
buf.Append(array[i]);
if (i < maxIndex)
buf.Append(", ");
}
buf.Append("]");
return buf.ToString();
}
}
}
Related examples in the same category