17.11.2012, 17:16
I'm trying to capitalize a whole string. However, I could only find toupper which does one letter. If anyone can find me the function to do that, I'd really appreciate it.
new newstring[256];//or any size larger may be?
for( new i, c = strlen(string); i < c; i++ )
{
format(newstring,sizeof(newstring),"%s%c",newstring,toupper(string[i]));
}
//use newstring now it must be capitalized ..!
loop + to upper
say if u have a string names string then to capitalize it try this -> pawn Код:
|
for(new i, len = strlen(string); i < len; ++i)
{
string[i] = toupper(string[i]);
}