c# - Add spacing to textbox results -


hi there have following code-

        richtextbox1.text = richtextbox1.text + action + "ok: " + ok.tostring();         richtextbox1.text = richtextbox1.text + "err: " + err.tostring();         richtextbox1.text = richtextbox1.text + "\r\n";         textbox1.text = textbox1.text; 

the results -

ok:7err:0

but want-

ok:7

err:0

with spacing, make better how can this?

you add 2 lines:

richtextbox1.text += environment.newline; richtextbox1.text += environment.newline; 

between "ok" , "err" - assuming want blank line between 2 lines of output. however, should either using string.format or stringbuilder create output concatenating strings way in inefficient.

you don't need final:

textbox1.text = textbox1.text; 

as setting text box contents , nothing.


Comments