0
How do I make every 29 digits the line break?
var hs = hs_codes.Text;
var texto = new StringBuilder(hs.Length);
var digito = true;
foreach(var chr in hs)
{
if (char.IsDigit(chr))
{
if (!digito) texto.Append(';');
texto.Append(chr);
digito = true;
}
else digito = false;
}
txt_alterado.ReadOnly = false;
txt_alterado.Focus();
txt_alterado.Text = Convert.ToString(texto);
Break up like?
– Maniero
every 29 digits it breaks in the textbox, I’m not able to do with /n/r
– Renan
TextBox
does not deal with line break.– Maniero
One should use a
RichTextBox
with the propertyMultiLine = true
.– CypherPotato