string.Compare using wildcards
-
Hi, I'm trying to search a datagrid/datatable using
string.Compare
, and doing something wrong when trying to use wildcards. I havesearchThis
as the string to search for, which works fine withstring.Compare(search, searchThis);
. But when I try to makesearchThis = "*" + searchThis + "*";
it doesn't work. I'm sure it's pretty simple, but haven't been able to find the answer yet. Thanks for any help! Mel -
Hi, I'm trying to search a datagrid/datatable using
string.Compare
, and doing something wrong when trying to use wildcards. I havesearchThis
as the string to search for, which works fine withstring.Compare(search, searchThis);
. But when I try to makesearchThis = "*" + searchThis + "*";
it doesn't work. I'm sure it's pretty simple, but haven't been able to find the answer yet. Thanks for any help! MelThe Compare method doesn't support wildcards. If you want to search entire strings with wildcard support, you'll have to use Regular Expressions[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
The Compare method doesn't support wildcards. If you want to search entire strings with wildcard support, you'll have to use Regular Expressions[^]. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome