SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: replacing texts

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    replacing texts

    Hi,

    Is it possible to replace lines of texts in richtextbox in C#?

    like,
    start_line = 3, end_line= 10

    for(i=start_line; i< end_line; i++)
    {
    rtb.replaceText(i);
    }

    Thanks

  2. #2
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    656
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shivam0101 View Post
    Hi,

    Is it possible to replace lines of texts in richtextbox in C#?

    like,
    start_line = 3, end_line= 10

    for(i=start_line; i< end_line; i++)
    {
    rtb.replaceText(i);
    }

    Thanks
    Is this all of your code? What are you trying to replace it with? Your current form will do nothing.

    --------------------------

    My bad, didn't see the Date of the OP.
    Chuck Norris is so tough, mosquitos ask for permission before they bite him

  3. #3
    SitePoint Member
    Join Date
    Oct 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    rtb.Text = rtb.Text.Replace("what to replace", "what to replace with");


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •