J
Janaka
Hi I was wondering if there was an easy way to convert a System.Array object
to a string[] ?
The only solution I can find is to iterate through the System.Array and
populate the string[] object like so:
// populate an Array object called 'values' ....
// create a new string array
string[] newArray = new string[values.Length];
// loop through the 2-D System.Array and populate the 1-D String Array
for (int i = 1; i <= values.Length; i++)
{
if (values.GetValue(1, i) == null)
newArray[i-1] = "";
else
newArray[i-1] = (string)values.GetValue(1, i).ToString();
}
to a string[] ?
The only solution I can find is to iterate through the System.Array and
populate the string[] object like so:
// populate an Array object called 'values' ....
// create a new string array
string[] newArray = new string[values.Length];
// loop through the 2-D System.Array and populate the 1-D String Array
for (int i = 1; i <= values.Length; i++)
{
if (values.GetValue(1, i) == null)
newArray[i-1] = "";
else
newArray[i-1] = (string)values.GetValue(1, i).ToString();
}