Note - the following code assumes that len(b) <= len(a)
[code]
Dim a As String = "abcdefghijklmnopqrstuvwxyz"
Dim b As String = "rahman"
Dim c As String = ""
Dim ch As Char
For i As Integer = 0 To Len(a) - 1
'If there are still chars left in … Read More

You'll have to be clearer on what you are trying to do. You have a string (not an array as you stated), a, that contains "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and a string (again, not an array), b that contains "RAHMAN". How do you determine what you want to put into array (this time you are correct), c?

Dim a As String = "abcdefghijklmnopqrstuvwxyz"
Dim b As String = "rahman"
Dim c As String = ""
Dim ch As Char
For i As Integer = 0 To Len(a) - 1
'If there are still chars left in b then pick a char from a (if a=b)
'or from b (if a <> b). If there are no more chars in b then just take
'the next char from a
If i < Len(b) Then
ch = IIf(a(i) = b(i), a(i), b(i))
Else
ch = a(i)
End If
'If the selected char is not already in c then add it to c
If InStr(c, ch) = 0 Then
c += ch
End If
Next
MsgBox(c)

First let's get the algorithm correct. We start by comparing a(0) to b(0). They are not equal so c gets b(0). What are the next two things to compare? Do we compare a(0) to b(1) or a(1) to b(1)? When do we increment the index into a? If we are never going to increment the index for string "a" then what is the point of comparing chars in string "a" to chars in string "b"?

I'm not saying that rahmnbcdefgijklopqstuvwxyz is the wrong answer. I'm saying that if rahmnbcdefgijklopqstuvwxyz is the right answer then you will have to explain why it is the right answer. In other words, what is the algorithm you are using to generate c? If you don't know the answer to that then you can't write a program to do it.