I have a blob of text that I need to split up with a list of Titles and Surnames contained therein. They are all separated by spaces, there are no carriage returns at all.
For example:
Mr Smith Mr Johnson Mrs Johnson Ms Smith
and so on and so on
I need to break these up into individual names so that I have something like the following
[0] = Mr Smith
[1] = Mr Johnson
[2] = Mrs Johnson
[3] = Ms Smith
Any help would be greatly appreciated.
I am using the .NET framework C# (just in case that is useful to someone).
I’d try
if every title is indeed one of “Mr”, “Mrs”, or “Ms”. This approach allows for quite a lot of unusual surnames, but needs to know every title in advance. See it in action at ideone.com