Is a character considered within 5 feet of another character if it is diagonal to it? In dnd 5e

I couldn’t find something about this in the players handbook (it is entirely possible I might have missed something), but is a character considered (within 5 feet) of another character if it is diagonal to it?