Split string before (

Hi,

I have a list of strings like below:
Hello123 wqhu (Collision)
Accident (Hit and run)

I want to split the string where I want only the value before (
Expected output :
Hello123 wqhu
Accident

Please let me know how to achieve this

Hi @Aishwarya
So you would like to cut (Collision) and (Hit and run ), may I ask?

Yes you are right, only the values before ( is required

You can try this: strInput.Split("("c)
strInput is the string you want to split. The return is a list of strings, split by letter “(”.
You can use For Each loop to see the result yourself.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.