Utile.cs 624 B

123456789101112131415161718192021
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace CG67.FicheCollege.Domaine
  5. {
  6. public static class Utile
  7. {
  8. /// <summary>
  9. /// formate un string sous forme de prénom.
  10. /// </summary>
  11. /// <param name="str"></param>
  12. /// <returns>string formaté en type prénom, exemple : MIckAeL, retournera Mickael</returns>
  13. public static string formatStringPrenom(string str)
  14. {
  15. string retour = str.Substring(0, 1).ToUpper();
  16. retour += str.Substring(1, str.Length - 1).ToLower();
  17. return retour;
  18. }
  19. }
  20. }