se quiseres uma função (stock) aqui possui, no código úteis...
o usuario Dr Editor, fez uma postagem de um código que faz essa função que você queres...
seu uso:
exemplo:
	
	
	
o usuario Dr Editor, fez uma postagem de um código que faz essa função que você queres...
Código:
enum
{
    TO_LOWER,
    TO_UPPER,
    INTERCALATE,
    INVERT,
    UPPER_FIRST_CHAR
}
stock ChangeStringCase(input_text[], output_text[], case_type)
{
    new count = 0;
    if(case_type == TO_LOWER)
    {
        while(count < strlen(input_text))
        {
            new _char[2];
            format(_char, 2, "%c", tolower(input_text[count]));
            strcat(output_text, _char, strlen(input_text) + 1);
            count ++;
        }
    }
    else if(case_type == TO_UPPER)
    {
        while(count < strlen(input_text))
        {
            new _char[2];
            format(_char, 2, "%c", toupper(input_text[count]));
            strcat(output_text, _char, strlen(input_text) + 1);
            count ++;
        }
    }
    else if(case_type == INTERCALATE)
    {
        new bool:intercalate = true;
        while(count < strlen(input_text))
        {
            new _char[2];
            format(_char, 2, "%c", intercalate ? toupper(input_text[count]) : tolower(input_text[count]));
            strcat(output_text, _char, strlen(input_text) + 1);
            intercalate = !intercalate;
            count ++;
        }
    }
    else if(case_type == INVERT)
    {
        while(count < strlen(input_text))
        {
            new _char[2];
            switch(input_text[count])
            {
                case 'a'..'z':
                {
                    format(_char, 2, "%c", toupper(input_text[count]));
                    strcat(output_text, _char, strlen(input_text) + 1);
                }
                case 'A'..'Z':
                {
                    format(_char, 2, "%c", tolower(input_text[count]));
                    strcat(output_text, _char, strlen(input_text) + 1);
                }
                default:
                {
                    format(_char, 2, "%c", input_text[count]);
                    strcat(output_text, _char, strlen(input_text) + 1);
                }
            }
            count ++;
        }
    }
    else if(case_type == UPPER_FIRST_CHAR)
    {
        new bool:upper = false;
        while(count < strlen(input_text))
        {
            new _char[2];
            switch(input_text[count])
            {
                case 'a'..'z', 'A'..'Z':
                {
                    if(upper)
                    {
                        format(_char, 2, "%c", toupper(input_text[count]));
                        strcat(output_text, _char, strlen(input_text) + 1);
                        upper = false;
                    }
                    else
                    {
                        format(_char, 2, "%c", input_text[count]);
                        strcat(output_text, _char, strlen(input_text) + 1);
                    }
                }
                default:
                {
                    format(_char, 2, "%c", input_text[count]);
                    strcat(output_text, _char, strlen(input_text) + 1);
                    upper = true;
                }
            }
            count ++;
        }
    }
}seu uso:
Código:
ChangeStringCase(input_text[], output_text[], case_type)exemplo:
Código:
new teste0[13] = "PoRtAl SaMp";
new teste1[13];
ChangeStringCase(teste0,teste1,TO_LOWER);
resultando:
printf("%s",teste1); 
// "portal samp"Citar:
Gostou do meu conteúdo? que tal me ajudar com alguma reputação? ( Estrela )

 
	   
	

 
![[Imagem: bqXFE9c.gif]](https://i.imgur.com/bqXFE9c.gif)
![[Imagem: 5I0uca9.png]](https://i.imgur.com/5I0uca9.png)