JabbabSquab The "proper shader way" of doing this would be:

The value that comes out of the multiply node will be 0 or 1 depending on whether the fragment is inside or outside of range. This value can then be used to mix/mask other values. Note that you can blur the edges of the area by using smoothstep instead of step. In that case you'll need an additional parameter that defines the smoothing range. The output from the multiply node will then be a gradient in the range 0-1 instead of just discrete 0 or 1. This is an extremely common shader idiom.
For the example I used the UV.x as an input but any other varying can be plugged here instead.
This, of course, looks much simpler when done in code. It's just one line:
float mask = step(min_value, UV.x) * step(UV.x, max_value);