How to remove text in a string variable


I have an excel file output for example,

Sales for Today (Average price: 20 euro)
Bargain shampoo (Average price: 3 euro).

Please advise how I could remove the (Average price: 20 euro) and (Average price: 3 euro) to produce.

Sales for Today
Bargain shampoo



If string “(average price” is fixed and it is unique, how about split whole text with it?


Can u share the example. Actually, the text following (Average…) is towards the end and not needed. So yes, we could make the assumption.

Please refer this.

like this.

Thanks. I will try.

Hi! For something more generic, please try this:
"Sales for Today (Average price: 20 euro)".Substring(0,"Sales for Today (Average price: 20 euro)".IndexOf(" ("))

Let me know if it works or if you need something else!

Thanks. I will check it out.

1 Like