Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdbool.h>
- #include <string.h>
- [...]
- bool substituirVogaisPorEspaco(char *string){
- char vogais[]="aeiouAEIOU";
- bool substituiu, tmp;
- for( int i=0; i<strlen(vogais); i++){
- tmp = substituirCaractere(string, vogais[i], ' ');
- if(tmp){
- substituiu = tmp;
- }
- }
- return substituiu;
- }
- bool substituirNumerosPorLetras(char *string){
- char numeros[]="0123456789";
- bool substituiu, tmp;
- for( int i=0; i<strlen(numeros); i++){
- tmp = substituirCaractere(string, numeros[i], 'A');
- if(tmp){
- substituiu = tmp;
- }
- }
- return substituiu;
- }
- bool substituirCaractere(char *string, char antigoCaractere, char novoCaractere){
- bool substituiu = false;
- for( int i=0; i<strlen(string); i++){
- if(string[i] == antigoCaractere){
- string[i] = novoCaractere;
- substituiu = true;
- }
- }
- }
- return substituiu;
- }
- [...]
Advertisement
Add Comment
Please, Sign In to add comment