Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Articulos.CSharp.MetodosExtension
- {
- public static class AyudanteString
- {
- // Capitaliza una cadena de caracteres:
- public static bool Capitalizar(this String cadena)
- {
- if (String.IsNullOrEmpty (cadena))
- {
- return false;
- }
- return String.Format("{0}{1}", cadena.Substring(0,1).ToUpper(), cadena.Substring(1).ToLower());
- }
- // Pluraliza una palabra:
- public static string Pluralizar(this String cadena)
- {
- if (String.IsNullOrEmpty (cadena))
- {
- return "";
- }
- return String.Format("{0}s", cadena);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement