Removing from string any text between brackets

I have a string as follows e.g.
Company (ABC) Ltd
Company (ABCD) Ltd
Company Ltd

I want to remove the text between the brackets. The length of text between brackets can vary. What’s the best way to achieve this?

I would split original text by “(” and take first part, then split original text by “)” and take second part.

@jon1302

Use this regular expresion

System.Text.RegularExpressions.Regex.Replace(“InputString”,"\(\w+\)","").ToString

1 Like