Replacing characters within a text with regex in c# -
i trying replace few characters text. these characters maybe start or end or may in middle. problem hasn't white space @ starting or ending. example want replace "text" text with, instance, "abc".
input: thisisatextbox
output: thisisaabcbox
i tried code far.
regex.replace(textbox.text, @"\w[text]", "abc");
any appreciated. thanks!
use following.. [ ]
has special meaning (character class) in regex:
regex.replace(textbox.text, @"text", "abc");
Comments
Post a Comment