Advertisement
RusNuker

Mass lowercaser for C char[] strings

Feb 13th, 2023
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1.  
  2.  
  3. // <3 <3 <3
  4. #define IS_INRANGE(num, a, b) ((a-1<num)&&(num<b+1))
  5.  
  6. void toLowerCase (char * string, int size) {
  7.     int temp;
  8.     for (int i = 0; i < size; ++i)
  9.     {
  10.         temp = string[i];
  11.         if (IS_INRANGE(temp, 65, 90))
  12.             string[i] = temp+32;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement