Select text from a Richtextbox in C#
问题 I want to select the text that is between the last '{' and '}' of a richtextbox text. I have the next code, but I have an error on the "LastIndexOf" function and I don't know how to fix it. Can someone give me some help? private void highlightText() { mRtbxOperations.SelectionStart = mRtbxOperations.Text.LastIndexOf(@"{", 1, mRtbxOperations.SelectionStart); mRtbxOperations.SelectionLength = mRtbxOperations.Text.IndexOf(@"}", mRtbxOperations.SelectionStart, mRtbxOperations.Text.Length - 1);