stringbuilder - How many spaces does \t use in c# -
i building report using stringbuilder , details of intended , aligned using
private static int paperwidth = 55; //it defines size of paper private static readonly string singleline = string.empty.padleft(paperwidth, '-'); stringbuilder reportlayout; reportlayout.appendline("\t" + "store name");
want store name in center , many such more feilds use of \t
in advance.
edit want print like. store name in center
if you're simulating tabs @ terminal should stick
8 spaces per tab. tab character shifts on next tab stop. default, there 1 every 8 spaces. in shells can edit whatever number of spaces want
you can realize through following code:
string tab = "\t"; string space = new string(' ', 8); stringbuilder str = new stringbuilder(); str.appendline(tab + "a"); str.appendline(space + "b"); string output = str.tostring(); // give 2 lines of equal length int lengthofop = output.length; //will give 15 from above example can in
.netlength of\tcalculated1
Comments
Post a Comment