Release GSC toUpper Function

The Dark Side

Former Staff Member
Messages
1,007
Points
568
ohhhhh i like this. Thank you :smile:

also it should be called like

Code:
self iPrintLn(toUpper("xXPuSsYSLAyEr"));
You missed a bracket thing lol :tonguewink:
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,275
Points
553
I was bored and was looking through some GSC functions and noticed there was a standard toLower function but no toUpper so I thought I would release one for the uh... beginners haha. It could be used for something like a subMenu with player names so it converts them to uppercase and makes the menu look a little neater, or something, idk.

Here's the code:
Code:
toUpper(text)
{
    alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    build = "";

    for(i = 0; i < text.size; i++)
        build += isSubStr(alphabet, text[i]) ? alphabet[i] : text[i];

    return build;
}
Call it like so:
Code:
self iPrintLn(toUpper("xXPuSsYSLAyEr"));
True. Nice idea! Thanks for sharing. :y:
 

Tusta

Head Member
Donator
Messages
19
Points
164
Cool but better is you save the strings at the server so can everyone use the function with the same strings! :smile:
 
Top