Skip to content

Commit

Permalink
Merge pull request #488 from Willjobs94/features/487-add-initials-onl…
Browse files Browse the repository at this point in the history
…y-if-is-alphanumeric-value

Add initials only if is a valid value
  • Loading branch information
luis-ramirez committed May 8, 2016
2 parents f9e172f + 5da16e5 commit 064e0ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion EmpleoDotNet/Helpers/HtmlHelperExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Microsoft.Ajax.Utilities;

namespace EmpleoDotNet.Helpers
{
Expand Down Expand Up @@ -61,14 +63,15 @@ public static string IsSelected(this HtmlHelper html, string controllers = "", s
}
return string.Empty;
}
/// <summary>
/// Obtener de las dos primemras palabras su primera letra. Sí el texto solo posee una palabra solo se retorna la primera letra de la misma
/// </summary>
/// <param name="helper">Variable de extensión</param>
/// <param name="value">Valor a procesar</param>
/// <returns>HtmlString</returns>
public static IHtmlString FirstTwoLetters(this HtmlHelper helper, string value)
{
var splited = value.Split(' ');
var splited = Regex.Split(value, @"[_+-.,!@#$%^&*();\/|<> ]|[0-9]");
var result = string.Empty;

foreach (var currentValue in splited)
Expand Down

0 comments on commit 064e0ca

Please sign in to comment.