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;
}
__________________