Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- @Função: Troca a letra de palavras.
- @Créditos: [iPs]SuYaNw
- */
- stock SwitchChar(string[], ch, ch2)
- {
- #if !defined MAX_STRING
- #define MAX_STRING (128)
- #endif
- new out[MAX_STRING];
- for(new i, e = strlen(string); i != e; ++i)
- {
- string[i] = (string[i] == ch ? (out[i] = ch2) : (out[i] = string[i]));
- }
- return out;
- }
- //Como Usar/Exemplo de uso:
- public OnFilterScriptInit()
- {
- printf("%s", SwitchChar("Olá, quero trocar 'o' por 'a'", 'o', 'a'));
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment