//this wil not compile

using System;
using System.Collections;
namespace stringarray_to_systemarray
{
public class SamplesArray
{
static int i = 0;
public void process(string ss)
{
string word = ss;
string[] str = word.Split(new Char [] {' ', ',', '.', ':'});
int n1 = word.Length;

Array mysource =Array.CreateInstance( typeof(String), n1 );
foreach (string s in str) {
if (s.Trim() != "")
mysource.SetValue(s,i);
i++;
//Console.Write("Preceddc " + s);

}
array_copyto(mysource, ' ');
}
public void array_copyto(Array myArr, char sep )
{
System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
int i = 0;
int cols1 = myArr.GetLength( myArr.Rank - 1 );
///
System.Array my_cyto;
myArr.Copy(myArr,my_cyto, cols1);
int n2 = my_cyto.GetLength( myArr.Rank - 1 );
System.Collections.IEnumerator mycyEnumerator = my_cyto.GetEnumerator();
Console.WriteLine ("array_copyto");
while ( mycyEnumerator.MoveNext() ) {
if ( i < n2 ) {
i++;
} else {
//Console.WriteLine();
i = 1;
}
Console.Write( "{0}{1}", sep, mycyEnumerator.Current );
}
Console.WriteLine( "{0}", n2);
}
}

class test
{
public static void Main() {
Console.Write("Enter a senctence : ");
string str = Console.ReadLine();
SamplesArray sa = new SamplesArray();
sa.process(str);


Console.ReadLine();
}
}
}
 

using System;
using System.Collections;
//csc array_CopyTo_array_string.cs
namespace stringarray_to_systemarray
{
public class SamplesArray
{
static int i = 0;
public void process(string ss)
{
string word = ss;
string[] str = word.Split(new Char [] {' ', ',', '.', ':'});
int xx =str.Length;
Console.WriteLine(xx);
int n1 = word.Length;
Array mysource =Array.CreateInstance( typeof(String), xx );
foreach (string s in str) {
if (s.Trim() != "")
mysource.SetValue(s,i);
i++;
//Console.Write("Preceddc " + s);

}
//keeping some room for unknown funtion or spaces coming
//during runtime
Array myt =Array.CreateInstance( typeof(String), xx + 5);
mysource.CopyTo(myt,xx);
//
abcd(myt);
}
public void abcd(Array myArr )
{
Console.WriteLine("----------------");
System.Collections.IEnumerator myEnumerator = myArr.GetEnumerator();
int i = 0;
int cols = myArr.GetLength( myArr.Rank - 1 );
string str = " ";
string sead ="";
Console.WriteLine ("abcd");
while ( myEnumerator.MoveNext() ){
if( i < cols ) {
i++;

} ;

sead += myEnumerator.Current + str ;
Console.Write( myEnumerator.Current + str );

}
//Console.Write( myEnumerator.Current + str );
//Console.Write( myEnumerator.ToString() + str );
Console.WriteLine();
Console.WriteLine(sead);
string strim = sead.TrimStart(null);
Console.WriteLine(strim);
Console.WriteLine("Array Length: {0}", cols);
}
}

class test
{
public static void Main() {
Console.Write("Enter a senctence : ");
string str = Console.ReadLine();
SamplesArray sa = new SamplesArray();
sa.process(str);


Console.ReadLine();
}
}
}
 

I attempted to to match scale several ways, later decided to set with length n1 (that is original length of the string that will be always more than the procces one(xx));

array_CopyTo_array_string.cs

however when added a huge string


Note this image where I modified xx+ 5 to xx+20, realized that there are several null values added during the run time.

Link to the final version: Link