vbdotnetxt Posted April 29, 2006 Posted April 29, 2006 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? Quote
barski Posted April 30, 2006 Posted April 30, 2006 bool isEqual=firstStr.Equals(secondStr.SubString(0,6)); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.