Advertisement
DraKiNs

[COD] Completar String (complet string)

Aug 30th, 2011
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.45 KB | None | 0 0
  1. /*
  2.    Author:    Bruno da Silva
  3.    www.ips-team.blogspot.com
  4. */
  5.  
  6. // Está função completa uma string com um determinado caracter:
  7.  
  8. completarString(string[], caractere, size = sizeof(string))
  9. {
  10.     for(new i = strlen(string); i != size; ++i)
  11.     {
  12.         format(string, size, "%s%c",string, caractere);
  13.     }
  14.     return string;
  15. }
  16.  
  17. //Exemplo:
  18. new stringTeste[10] = "Teste";
  19. completarString(stringTeste, '@', sizeof(stringTeste));
  20.  
  21. //Resultado:
  22. Teste@@@@@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement