Hi ahsan.ali,
check this example. now please take its reference and correct your code.
HTML
<asp:Label Text="" runat="server" ID="lblName" />
Namespace
C#
using System;
using System.Collections.Generic;
VB.Net
Imports System
Imports System.Collections.Generic
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string name = "quick";
string mystring = "ahsan";
char[] input1 = name.ToCharArray();
char[] input2 = mystring.ToCharArray();
int length = input1.Length >= input2.Length ? input1.Length : input2.Length;
List<char> lists = new List<char>();
for (int i = 0; i < length; i++)
{
if (input1.Length > i)
{
lists.Add(input1[i]);
}
if (input2.Length > i)
{
lists.Add(input2[i]);
}
}
lblName.Text = string.Join("", lists.ToArray());
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim name As String = "quick"
Dim mystring As String = "ahsan"
Dim input1 As Char() = name.ToCharArray()
Dim input2 As Char() = mystring.ToCharArray()
Dim length As Integer = If(input1.Length >= input2.Length, input1.Length, input2.Length)
Dim lists As List(Of Char) = New List(Of Char)()
For i As Integer = 0 To length - 1
If input1.Length > i Then
lists.Add(input1(i))
End If
If input2.Length > i Then
lists.Add(input2(i))
End If
Next
lblName.Text = String.Join("", lists.ToArray())
End Sub
Output
qauhiscakn