machan mekai mata string count ekak hadanna one. mata one fiue textbox ekakata load karan eke character count eka ganna one. string eke length aran eken thiyena spaces adu karala. 1d array eken karata ms word ekak wage load karama hama dimension ekakma thiyena string cnt wenna 2d array ona neda bn?
mage danata code eka meka
private void button1_Click(object sender, EventArgs e)
{
string file = "D://test1.txt";
System.IO.StreamReader obj = new System.IO.StreamReader(file);
string[,] box = textBox1.Text;
box = obj.ReadToEnd();
int count = box.Length;
int rea = 0;
int spaces = 0;
for (int i = 0; i < box.Length; i++)
{
for (int j = 0; j < box.Length; j++)
{
if (box[i,j].Equals(" "))
{
spaces = spaces + 1;
}
}
}
rea = count - spaces;
MessageBox.Show(rea.ToString());
}
}