Hello again,
Sure, a voltage regulator does that. If the input is 12v, you get 5v out, if the input is 11v, you get 5v out, if the input is 10v you get 5v out, you always get 5v output UNLESS the input goes below some minimum requirement, and the difference between the input and output at that point is called the "dropout voltage" of the regulator. For example, if the dropout voltage is 2 volts and the output is 5v, then the min input voltage is 7 volts or else the output will start to drop.