How to Zip two numbers using c# -


string = "1234" string b = "567890"

i want zip numbers. out put should display "1526374890"

what best way achieve using c# code.

you can following code. not make assumptions string longer.

string = "1234"; string b = "567890";  char[] chars = new char[a.length + b.length]; int charsindex = 0; (int = 0; < a.length || < b.length; i++) {     if(i < a.length)         chars[charsindex++] = a[i];     if(i < b.length)         chars[charsindex++] = b[i]; } string result = new string(chars);  console.writeline(result); 

Comments