318
1
using System;
2
using System.Diagnostics;
3
using System.Text;
4
using System.Text.RegularExpressions;
5
6
7
public static class StringExtensions {
8
9
10
public static string GetAllIntRegex(this string numint)
11
{
12
return Regex.Replace(numint, "[^0-9]", "");
13
14
}
15
16
17
public static string GetLeadIntFast(this string numint)
18
{
19
bool minus = false; //we pass in absolute number
20
if (numint.IndexOf('-') == 0)
21
{
22
minus = true;
23
numint = numint.Replace("-", ""); //we expect this to be in first place, not bullet proof but GE
24
}
Cached Result