SearchUtils.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace comal.timesheets.Data_Classes
  5. {
  6. public static class SearchUtils
  7. {
  8. public static String UpperCaseFirst(string s)
  9. {
  10. char[] a = s.ToCharArray();
  11. a[0] = char.ToUpper(a[0]);
  12. return new string(a);
  13. }
  14. public static String LowerCaseFirst(string s)
  15. {
  16. char[] a = s.ToCharArray();
  17. a[0] = char.ToLower(a[0]);
  18. return new string(a);
  19. }
  20. public static String UpperCaseSecond(string s)
  21. {
  22. char[] a = s.ToCharArray();
  23. if (a.Length >= 2)
  24. {
  25. a[0] = char.ToUpper(a[0]);
  26. a[1] = char.ToUpper(a[1]);
  27. return new string(a);
  28. }
  29. else
  30. return s;
  31. }
  32. public static String UpperCaseThird(string s)
  33. {
  34. char[] a = s.ToCharArray();
  35. if (a.Length >= 3)
  36. {
  37. a[0] = char.ToUpper(a[0]);
  38. a[1] = char.ToUpper(a[1]);
  39. a[2] = char.ToUpper(a[2]);
  40. return new string(a);
  41. }
  42. else
  43. return s;
  44. }
  45. public static String UpperCaseFourth(string s)
  46. {
  47. char[] a = s.ToCharArray();
  48. if (a.Length >= 4)
  49. {
  50. a[0] = char.ToUpper(a[0]);
  51. a[1] = char.ToUpper(a[1]);
  52. a[2] = char.ToUpper(a[2]);
  53. a[3] = char.ToUpper(a[3]);
  54. return new string(a);
  55. }
  56. else
  57. return s;
  58. }
  59. }
  60. }