Guest User

XF CH3WY's String Squiggle Check

a guest
Aug 27th, 2017
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. /*-----------------------------
  2.     XF CH3WY's Squiggle Check
  3.     *DO NOT EDIT
  4.   -----------------------------*/
  5.  
  6. ///BUFFETINGS FUNCTIONS
  7. #define substring(str, startIndex, stopIndex) GET_STRING_FROM_STRING(str, startIndex, stopIndex)
  8.  
  9. #define charAt(str, index) substring(str, index, index+1)
  10.  
  11. bool IsSquiggleInString(char* stringName)
  12. {
  13.     int i = 0, squiggleCount = 0;
  14.     for(i = 0;i < GET_LENGTH_OF_LITERAL_STRING(stringName);i++)
  15.     {
  16.         char* charTxt;
  17.         charTxt = charAt(stringName, i);
  18.         if(!COMPARE_STRING(charTxt, "~")) continue;
  19.         squiggleCount++;
  20.     }
  21.     if(squiggleCount > 0)
  22.     {
  23.         return true;
  24.     }
  25.     return false;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment