Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a RichTextBox control on my form1. I have two strings called firstStr and secondStr.

firstStr = "(123456)"

secondStr = "(1234567890)"

I want to select 123456 from the secondStr.

 

This is how I wanted to do it and print it to the RichTextBox:

 

secondStr.Select(1,7)
RichTextBox.Text = secondStr.SelectedText

 

but it doesn't work :(

 

this doesn't work either:

 

secondStr.SelectionStart = 1
secondStr.SelectionLength = 7
RichTextBox.Text = secondStr.SelectedText

 

I want to eventually compare the selected text with firstStr.

How can I do that?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...