vb.net - Copy RichTextBox string based on string position -


I have a long TXT string imported in RichTextBox. I am trying to copy a part of that text which Based on the initial and final points based on the text string. Here's what I have done so far,

  Dim StartsearchString string = "MyStartString" as the slow EndSearchString string = dim length "MyEndString" integer slot StartPoint integer slow endpoint integer length1 = lane (StartsearchString) Length2 = Lane (EndSearchString) StartPoint = Form2.RichTextBox2.Find (StartsearchString) + Length1 EndPoint = Form2.RichTextBox2.Find (EndSearchString) - Length2   

How can I copy text between start and end points and paste it into a new RichTextBox?

Thank you.

"itemprop =" text ">

Your endpoint is off because you do not have to reduce the length of the endstrings. Those who search for is the beginning of the index that is the beginning of the search,

I did it again using the substring function like this:. String = "Slow StartPoint Integer = RichTextBox2.Find (StartsearchString) Dim EndPoint Integer = RichTextBox2.Find (EndSearchString) as the Dim StartsearchString String =" MyStartString "as the EndSearchString In "MyEndString" as EndPoint & gt; StartPoint then OtherRTB.Text = RichTextBox2.Text.Substring (StartPoint + StartsearchString.Length, EndPoint - StartPoint - StartsearchString.Length) end then

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -