banking-bot/BankingBot/Extensions/StringExtensions.cs
2017-02-10 19:05:26 +00:00

13 lines
282 B
C#

using System;
using System.Text.RegularExpressions;
namespace BankingBot.Extensions
{
public static class StringExtensions
{
public static int AsInteger(this string str)
{
return int.Parse(Regex.Replace(str, @"[^\d]", ""));
}
}
}