You will not find something that correctly formats such a name. The reason is that the reason M and D at McDougal are capitalized is an arbitrary regional thing. The only way I can think of doing something like this is with a lookup table. I would say that the best you get programmatically is "mcdougal".capitalize
=>" Mcdougal ". I would say that you cannot and should not guess the regional capital letters.
If, however, you are making an application for the Irish, and this is absolutely necessary. I would do a lookup table to solve this problem. This is tiring, but you will find a finite number of cases.
source share