3 of 3 added 35 characters in body

R, 30 27 22 bytes

Current solution due to user11599!


Takes input from stdin, returns each middle name as a separate string. Returns character() in the case of no middle name; that is, a vector of class character of length 0.


Read stdin into a list of strings, separated by spaces


Remove the last element. head returns the first n elements of a list, with n defaulting to 6. If n is -1 it returns all but the last element.


Now, remove the first element of this list.


This yields the middle name(s).