Remove row from string[]

Hi, saw alot of remove rows post but all of them about datatables. I have a one dimensional array and I cannot use copytodatatable function. Would like to remove rows that partial match to “S-GOOD”.
I tried this
dt.ToString.Remove(dt.IndexOf(“S-GOOD”))
But it is not working. Pls help

Thank you xoxo

Hi @sangasangasanga,

Try this code
(From q in dt.Select() where Not string.Join(",",q.ItemArray).Contains("S-GOOD") Select q).ToArray.CopyToDataTable()

Regards,
Arivu

image

Hi @sangasangasanga,

Main.xaml (12.4 KB)

Refer this xaml file.

Regards,
Arivu

Hi @arivu96 for your codes, it is only for datatable or can be used for string array?

Hi @sangasangasanga,

Try this code
(from str in variable2 where not str.ToString.Contains("A") select str).ToArray

Regards,
arivu

@arivu96 (from str in dtname where not str.ToString.Contains(“A”) select str).ToArray
Is this how it is written? As it is not working for me :frowning:

Hi @sangasangasanga,

Main.xaml (15.0 KB)

Refer this xaml file

Regards,
Arivu

1 Like