How to join 2 string[] objects
-
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
string[] s1 = { "one", "two" };
string[] s2 = { "three", "four" };
// what is the function to produce that one?
string[] s = { "one", "two", "three", "four" };Чесноков
-
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
string[] s1 = { "one", "two" };
string[] s2 = { "three", "four" };
// what is the function to produce that one?
string[] s = { "one", "two", "three", "four" };Чесноков
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me
-
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
string[] s1 = { "one", "two" };
string[] s2 = { "three", "four" };
// what is the function to produce that one?
string[] s = { "one", "two", "three", "four" };Чесноков
-
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
string[] s1 = { "one", "two" };
string[] s2 = { "three", "four" };
// what is the function to produce that one?
string[] s = { "one", "two", "three", "four" };Чесноков
simple table management string[] s = new string[s1.Length + s2.Length]; int _sCounter = 0; for(int i=0;i
-
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
string[] s1 = { "one", "two" };
string[] s2 = { "three", "four" };
// what is the function to produce that one?
string[] s = { "one", "two", "three", "four" };Чесноков
Chesnokov Yuriy wrote:
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
I think following function will do the stuff, right?
public static string[] ConcateArray(string[] s1, string[] s2)
{
string[] s = new string[s1.Length + s2.Length];
s1.CopyTo(s, 0);
s2.CopyTo(s, s1.Length);
return s;
}Just call the method as
string[] s = ConcateArray(s1, s2);
Knock out 't' from can't, you can if you think you can. :cool:
-
Chesnokov Yuriy wrote:
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
I think following function will do the stuff, right?
public static string[] ConcateArray(string[] s1, string[] s2)
{
string[] s = new string[s1.Length + s2.Length];
s1.CopyTo(s, 0);
s2.CopyTo(s, s1.Length);
return s;
}Just call the method as
string[] s = ConcateArray(s1, s2);
Knock out 't' from can't, you can if you think you can. :cool:
That will work though there is no inherent .NET function. I wich I had such a plethora of answers to that question ;) http://www.codeproject.com/Messages/3519974/How-to-invoke-native-MyFunction-MyStruct-myStructs.aspx[^]
Чесноков
-
Is there a single function that takes 2 string[] arrays and concatenates them together in a single string[] array?
string[] s1 = { "one", "two" };
string[] s2 = { "three", "four" };
// what is the function to produce that one?
string[] s = { "one", "two", "three", "four" };Чесноков
See
String.Join()
[^]. /raviMy new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com