ToLowerFilter.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /// Spart License (zlib/png)
  2. ///
  3. ///
  4. /// Copyright (c) 2003 Jonathan de Halleux
  5. ///
  6. /// This software is provided 'as-is', without any express or implied warranty.
  7. /// In no event will the authors be held liable for any damages arising from
  8. /// the use of this software.
  9. ///
  10. /// Permission is granted to anyone to use this software for any purpose,
  11. /// including commercial applications, and to alter it and redistribute it
  12. /// freely, subject to the following restrictions:
  13. ///
  14. /// 1. The origin of this software must not be misrepresented; you must not
  15. /// claim that you wrote the original software. If you use this software in a
  16. /// product, an acknowledgment in the product documentation would be
  17. /// appreciated but is not required.
  18. ///
  19. /// 2. Altered source versions must be plainly marked as such, and must not be
  20. /// misrepresented as being the original software.
  21. ///
  22. /// 3. This notice may not be removed or altered from any source distribution.
  23. ///
  24. /// Author: Jonathan de Halleux
  25. using System;
  26. namespace Spart.Scanners
  27. {
  28. /// <summary>
  29. /// A to lower input filter
  30. /// </summary>
  31. public class ToLowerFilter : IFilter
  32. {
  33. /// <summary>
  34. /// Converts s to lower string
  35. /// </summary>
  36. /// <param name="s"></param>
  37. /// <returns></returns>
  38. public String Filter(String s)
  39. {
  40. return s.ToLower();
  41. }
  42. /// <summary>
  43. /// Converts i to lower i
  44. /// </summary>
  45. /// <param name="i"></param>
  46. /// <returns></returns>
  47. public Char Filter(Char i)
  48. {
  49. return (Convert.ToString(i).ToLower())[0];
  50. }
  51. }
  52. }