Fetch string from a string using SubString function in C# and VB.Net

Chand
 
on Apr 11, 2018 05:05 AM
Sample_191139.zip
2301 Views

i have String "Key "L" work On Wed, Apr 11, 2018 at 11:07 AM, <ithelpdesk2571997@gmail.com> wrote: > Update By-->Chandni, > Description-->Key "L" and "M" not work, > Allocate To-->Chandni, > Status-->open. > > "

That was fetch from replay mail

But i want only "i have String "Key "L" work" so how to get particular String.

how to ignore other content and fetch onlt replay mailbody.

fetch mail using pop3

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
pandeyism
 
on Apr 11, 2018 06:02 AM

Hi Chand,

Check this example. Now please take its reference and correct your code.

Code

C#

protected void Page_Load(object sender, EventArgs e)
{
    string str = "i have String \"Key \"L\" work On Wed, Apr 11, 2018 at 11:07 AM, <ithelpdesk2571997@gmail.com> wrote: > Update By-->Chandni, > Description-->Key \"L\" and \"M\" not work, > Allocate To-->Chandni, > Status-->open. > > ";
    int index = str.IndexOf(" On");
    string result = str.Substring(0, index);
}

VB.Net

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    Dim str As String = "i have String ""Key ""L"" work On Wed, Apr 11, 2018 at 11:07 AM, <ithelpdesk2571997@gmail.com> wrote: > Update By-->Chandni, > Description-->Key ""L"" and ""M"" not work, > Allocate To-->Chandni, > Status-->open. > > "
    Dim index As Integer = str.IndexOf(" On")
    Dim result As String = str.Substring(0, index)
End Sub

Screenshot