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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -