AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   String uppercase (https://forums.alliedmods.net/showthread.php?t=210166)

bcKq 03-07-2013 10:50

String uppercase
 
Hello, how can I make a string uppercase?

PHP Code:

new szDesc[64];
new 
weapons[64];
format(weapons63"testing");
format(szDesccharsmax(szDesc), "%s"weapons);
// format(szDesc, charsmax(szDesc), "%s", strtoupper(weapons)); - doesn't work 

Weapons string is retrieved from another function and it's lower case. I want to make all characters in 'weapons' variable uppercase.
Function strtoupper doesn't work, it needs something like this - strtoupper("here");
but I need that: strtoupper(weapons); but it simply doesn't work, I get weird string then, like some sound.wav.

I need a function to make a variable uppercase.

hleV 03-07-2013 11:28

Re: String uppercase
 
PHP Code:

format(weapons63"testing");
strtoupper(weapons);
// weapons now equals "TESTING" 


bcKq 03-07-2013 11:35

Re: String uppercase
 
I'm stupid, thanks :)


All times are GMT -4. The time now is 21:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.