THIS IS HOW TO GET IN ONE ARRAY BY CODE THE ITEMS WITHOUT EMPTY OR CONTAINS ANY SPACE

image

THIS IS HOW TO PRINT IT IN WRITE LINE

"ARRAY = [" + String.Join(",",str_variableArray) + "]" +  vbCrLf + vbCrLf +
"PRINT str_variableArray AND ONLY TAKE THE ITEM WITHOUT SPACE = [" + String.Join(",",str_variableArray.AsEnumerable().Where(Function(item) Not String.IsNullOrWhiteSpace(item) AndAlso Not String.IsNullOrEmpty(item)).ToList) + "]" +  vbCrLf + vbCrLf

OUTPUT:
image

@Jesus_Fonseca try this

string.Join(",",str_varArray.Where(function(x) Not String.IsNullOrEmpty(x.Trim)))

cheers