If you wish to stay away from regular expressions, the simplest way I can think of is:
string input = "User name (sales)";
string output = input.Split('(', ')')[1];
More Related Contents:
- Using RegEx to balance match parenthesis
- How do I replace the *first instance* of a string in .NET?
- How do I access named capturing groups in a .NET Regex?
- What are regular expression Balancing Groups?
- Find a string between 2 known values
- Regular Expression to split on spaces unless in quotes
- Why does the order of alternatives matter in regex?
- Regex to strip line comments from C#
- Remove text in-between delimiters in a string (using a regex?)
- Why \b does not match word using .net regex
- RegEx for an IP Address
- Count regex replaces (C#)
- Translate Perl regular expressions to .NET
- Regex replace multiple groups
- Are Java and C# regular expressions compatible?
- C# – Regex for file paths e.g. C:\test\test.exe
- .Net regex: what is the word character \w?
- Regex: Repeated capturing groups
- Canadian postal code validation
- Why doesn’t $ in .NET multiline regular expressions match CRLF?
- How to use inline modifiers in C# regex?
- C# System.RegEx matches LF when it should not
- Regex for matching a character, but not when it’s enclosed in square bracket
- Regular expression for 10 digit number without any special characters
- What is a “Nested Quantifier” and why is it causing my regex to fail?
- Regex for extracting certain part of a String
- Regular expression to validate valid time
- How to replace the text between two characters in c#
- regex to split line (csv file)
- is there a elegant way to parse a word and add spaces before capital letters