A question about alphabetical order (need answer fast)

Here are two last names. Put them in alphabetical order.

The P in the first name is capitalized but I believe it is not a separate word as in De Pinho. So it should go second. But if there is a space, it would be first. Correct?

As written, “Dehaye” goes before “DePinho”. However, there are two different ways of treating words/phrases with spaces, usually called “letter by letter” (which ignores spaces) and “word by word” (which effectively files a space before the letter A). Typically, dictionaries use letter-by-letter filing, while library catalogues use word-by-word filing.

Internal capitals are usually ignored, though internal spaces may not be. However, what you need to do is choose one system and stick to it.

Note also if you’re having a computer doing this, it may well consider capital and small letters different and, if it’s sorting in ASCII or related order, all capitals come before every lower case letter.

The behavior can also differ from one computer to another. I know that Mac and Windows differ in how they treat numerals; they might well also differ in how they treat capitalization.