View Single Post
Author Message
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 04-05-2007 , 23:26   [stocks] String stocks
Reply With Quote #1

Here are some string stocks I found useful that I created in sourcepawn. It only works on string type variables

Code:
stock UTIL_StrToLower(String:Source[]) {     new len = strlen(Source);     for(new i = 0, b; i < len; i++)     {         b = Source[i];         if(b >= 65 && b <= 90)         {             Source[i] += (1<<5);         }     }     return 1; } stock UTIL_StrToUpper(String:Source[]) {     new len = strlen(Source);     for(new i = 0, b; i < len; i++)     {         b = Source[i];         if(b >= 97 && b <= 122)         {             Source[i] -= (1<<5);         }     }     return 1; } stock UTIL_IsSpace(ch) {     if(ch == 32)     {         return 1;     }     return 0; }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06