The common LM317 regulator can be configured as a constant-current (CC) or constant-voltage (CV) circuit. Both are often desired for such applications as battery charging.
Here is a circuit that does that with one LM317 and one TL431 programmable reference IC.
One common way in the literature...