Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何格式化 StringBuilder 以使下面的输出以正确填充的方式对齐,现在它只是一团糟!我正在使用 String Builder 以某种方式制作字符串:Stra.append(),Stra.append ("")
你可以使用stringBuilder.AppendFormat("{0,16}", number). 这将使您的数字右对齐,宽度为 16。
stringBuilder.AppendFormat("{0,16}", number)
您应该能够使用 vbtab 插入制表符或 vbcrlf 插入回车/换行,即
Stra.append(vbTab) Stra.append(VbCrLf)