Padright 补空格补不上解决思路
Padright 补空格补不上
我想通过补空格的方式,进行对齐,但是补不上,只有一个空格,其它的被截断了,请问该怎么办?
谢谢
------解决方案--------------------
我想通过补空格的方式,进行对齐,但是补不上,只有一个空格,其它的被截断了,请问该怎么办?
谢谢
foreach (var cat in cateTeam.SubCategories)
{
if (cat.IsMagazine.HasValue && cat.IsMagazine.Value)
{
@Html.ActionLink(cat.Name, "Magazine", "Lib", new RouteValueDictionary { { "id", cat.ID } }, null); //杂志类型
}
else
{
@Html.ActionLink(cat.Name, "Category", "Lib", new { id = cat.ID }, new { target = "_blank", title = cat.Name }) //一般分类
}
counter6 = counter6 + 1;
if (counter6 % 6 == 0)
{
<br />
counter6 = 0;
}
else
{
string strTemp = string.Empty;
int length = cat.Name.Length;
@strTemp.PadRight(15 - length, ' ');
}
}
------解决方案--------------------