I need to parse the system name from a larger string. The system name is prefixed with "ABC" and then the number. Here are some examples:
ABC500 ABC1100 ABC1300
the complete line in which I need to parse the system name may look like any of the following elements:
ABC1100 - 2ppl ABC1300 ABC 1300 ABC-1300 Managers Associates Only (ABC1100 - 2ppl)
before I saw the latter, I had this code that worked very well:
string[] trimmedStrings = jobTitle.Split(new char[] { '-', '–' },StringSplitOptions.RemoveEmptyEntries) .Select(s => s.Trim()) .ToArray(); return trimmedStrings[0];
but it does not work in the last example, where before ABC there is a bunch of other text.
Can anyone suggest a more elegant and promising way to parse the system name here?
leora source share