public int Statistics(int stat)
{
int statistic = 0;
switch (stat)
{
case 0: // word count
statistic = new Regex(@"\s+").Replace(txtPage.Text.Trim()," ").Split(' ').Length;
break;
case 1: // characters - no spaces
statistic = txtPage.Text.Replace(" ", "").Length;
break;
case 2: // charactesr - w/ spaces
statistic = txtPage.Text.Length;
break;
case 3: // lines
statistic = txtPage.Lines.Length;
break;
}
return statistic;
}