Hi
I have certain text to be extracted between two fixed set of labels. I tried some methods given but I was not able to do achieve the result what I want.(might be I ma missing something).
In the below text, I would like to extract the text between labels “Contact Details” and
“Shipping Details”
If you ordered an eBook you will receive a separate email with a registration key and instructions for accessing your eBook.
Shipping Details
Name: ABC
Company Name:
Country: XYZ
Shipping Address: AAAAAAA
City: dsds
State : dsds
Postcode: dsds
Summary
Please note that your order reference number is 232-3.
I thought of using in string , finding the index of contact details and then doing sub-string to extract the required text.
But I am not able to identify how to do in-string.
Is there any better method to perform the above operation.
If I understood well,below you can find my solution:
1.Store your String into a variable (ex:test_str)
2.test_str.Split({“Contact Details”,“Shipping Details”},StringSplitOptions.None)(1).Trim
You break the whole string after Contact Details and Shipping Details and access position 1 from the result and finnaly delete spaces using .Trim