JohnJuly

Dumb name of the method

Sep 28th, 2025 (edited)
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.23 KB | None | 0 0
  1. public static int GetConstrainedValue(int value, int lowerBound, int upperBound)
  2. {
  3.     if (value < lowerBound)
  4.         return lowerBound;
  5.     else if (value > upperBound)
  6.         return upperBound;
  7.     else
  8.         return value;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment