Helpers.cs 406 B

12345678910111213
  1. namespace CodeGenerators;
  2. public static class Helpers
  3. {
  4. private static string CapitalizeFirstLetter(string text) => string.IsNullOrWhiteSpace(text) ?
  5. string.Empty : text[..1].ToUpper() + text[1..];
  6. public static string SanitizeName(string text)
  7. {
  8. var onlyLetters = new string(text.Where(char.IsLetter).ToArray());
  9. return CapitalizeFirstLetter(onlyLetters);
  10. }
  11. }