Strict equality

Hello everyone, I have a small question:

I have a column in data table like this:
“ABC” <—NO replace
“AB” <—To replace
“AB” <—To replace
“AB CD” <—NO replace
“AB CDEF” <—NO replace
“AB” <—To replace

I replaced the “AB” with “99”, however it replaced ALL the strings for me. I would like to replace only the “AB” strings. How can I proceed?

Thank you

Hi @DimitriLYR

You can try with this expression

DtRead.AsEnumerable.Select(Function(r) DtRead.Clone.LoadDataRow({System.Text.RegularExpressions.Regex.Replace(r("ColumnName").ToString,"(?<=\n)AB$","99")},False)).CopyToDataTable

Regards
Gokul

1 Like

HI @DimitriLYR

Check out the XAML file

Find&Replace.xaml (12.6 KB)

image

Regards
Gokul

1 Like

I try, thank you :slight_smile:

Nice ! Thank you

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.