Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want the code to find and replace the word in C#.net.
It will done on richtextbox,that is i want to make this operations on richtextbox.
thanks.
Posted

Find And Replace Method For RichTextBox[^]
It's in VB but you can easily convert it to C#[^]
 
Share this answer
 
v2
Comments
Dalek Dave 21-Feb-11 4:29am    
Good Link.
try IndexOf and Replace Method of string Object
 
Share this answer
 
Hi,

You may want to use String.Replace:

MIDL
string myString = "xyz";
        myString = myString.Replace('x', 'y');
        Console.WriteLine(myString);


This should produce:
yyz

Use RichTextBox.Text to access the text.

Hope this helps

Laurence
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900