Copy to datatable from array

Hello, anybody able to help to breakdown this codes?
I’ve tested them to copy to another table after joining the datatables and it works. as the header names are hardcoded.
e.g.

(From r In joinDT.AsEnumerable
Let firstCol = If(String.IsNullOrEmpty(r("First").ToString),r("First_1").ToString,r("First").ToString)
Let secondCol = If(String.IsNullOrEmpty(r("Second").ToString),r("Second_1").ToString,r("Second").ToString)
Let ra = {"First", "Second", "Third", "Fourth"}.ToArray
Select resultDT.Rows.Add(ra)).CopytoDataTable

However i changed it to the below so as to have a more dynamic set of headers. and its not working as intended as the r here is counted as String instead or Row.

(From r In joinDT.AsEnumerable
Let firstCol = If(String.IsNullOrEmpty(r("First").ToString),r("First_1").ToString,r("First").ToString)
Let secondCol = If(String.IsNullOrEmpty(r("Second").ToString),r("Second_1").ToString,r("Second").ToString)
Let str= headerNames
Let str1 = str.Replace("r("+Chr(34)+"First" + Chr(34)+").ToString", firstCol).Replace("r("+Chr(34)+"Second" + Chr(34)+").ToString", secondCol)
Let ra = str1.Split(","c)
Select resultDT.Rows.Add(ra)).CopytoDataTable

I tried to make it into a big For each loop for each datarow and another for each for array inside to get the array for each row, and doesnt seem to work too…

Help please anybody