Here i have given two ways .In which I am breaking down the string when its index position is 10.
string[] xx= new string[TextBox1.Text.Length];
int l = xx.Length; int i;
for (i = 0; i <= xx.Length - 1 && l>10; i += 10,l-=10)
{
st1 = TextBox1.Text.Substring(i,10 );
st2 += st1+" ";
}
st1 = TextBox1.Text.Substring(i, l);
st2 += st1 + " ";
===========================================
int l = TextBox1.Text.Length; int i;
for (i = 0; i <= TextBox1.Text.Length - 1 && l>10; i += 10,l-=10)
{
st2 += TextBox1.Text.Substring(i, 10) + " ";
}
st2 += TextBox1.Text.Substring(i, l) + " ";
No comments:
Post a Comment