c# - ArgumentException was unhandled on String.Replace -
i created 2 textboxes "find" , "replace with" sort of combination. loop through cells in datagridview , check see if contains value in "find" box.
this has been working fine until tried find , replace "(" "" empty string
this string looking "(" find , replace in: the hitch hikers guide galaxy (s01xe06)
string orig = (string)(datagridview1.rows[i].cells["after"].value); string newfilename = regex.replace( orig, txtrenamefrom.text, txtrenameto.text, regexoptions.ignorecase);
then receive error: parsing "(" - not enough )'s.
you're using regex replace, ( special character in regular expressions. either normal string.replace or escape regex.
Comments
Post a Comment