using System.Text.RegularExpressions;
public static class StringExtensions
public static string Repeat(this string @this, int count)
if (String.IsNullOrWhiteSpace(@this))
return (new StringBuilder(@this.Length * count)).Insert(0, @this, count).ToString();
public static void Main()
var prompt = "Please Enter in a Fullname: ";
var name = Console.ReadLine();
var result = String.Join("", Regex.Matches(name, @"\b(\w{1})").OfType<Match>().Select(match => match.Groups[1].Value));
Console.WriteLine($"Initials: {result}");
Console.WriteLine(String.Empty);
Console.WriteLine("-".Repeat($"{prompt}{name}".Length));
Console.WriteLine(String.Empty);