Hallo Jim
"Jim Heavey" <Ji*******@discussions.microsoft.com> schrieb im Newsbeitrag
news:53**********************************@microsof t.com...
I am wanting to find any instance in a string where more then on occurance
of a value occurs and replace it with a single occurance of the value.
Specifically I want to search a text field and find any time where more then
a single ' (tic) occurs in succession, and replace it with a single ' (tic).
Can this be done with a RegularExpression? Any example of how to do this?
Do you mean that u want to do that with every possible value? so if youd
have a string like that:
aa++bb77jjkk..--hhjjkkll
it would return
a+b7jk.-hjkl
if you just want to replace '' with ' you could do something like this:
txtUser.Text.Replace("''", "'")
or for +
txtUser.Text.Replace("++", "+")
if you tryin to prevent a user to use sql injection in some of your forms, i
suggest you construct more security functions than that.
regards benni