Split the data in to an array

Hi Community
Can anybody help me to split the data into an array
the sample data is in the Text file
random.txt (883 Bytes)

sample output is {“African”,"Allbanian…}
Thanks and Regards
Sreejith

Hi @sreejith.ss

Try below code
arrvalue=strValue.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries)

Regards
Gokul

Output @sreejith.ss

Use Read Text File activity and pass the output variable as strValue

image

Regards
Gokul

Hey @sreejith.ss,

Try the below code and let me know if it’s working for you.

stringVar.Split(Environment.NewLine.ToCharArray()).Where(function(x)  not string.IsNullOrWhiteSpace(x)).ToList()

Thanks,
Sanjit

Hi @sreejith.ss ,

Try This:
Str_text.Split(Environment.NewLine.ToCharArray).AsEnumerable().Where(Function(x) Not String.IsNullOrEmpty(x.ToString.Trim)).ToArray()

Xaml is attached

Str_to_Array.xaml (4.9 KB)

Thanks,
Muthuraj