我正在尝试编写一个左对齐函数,例如:
private static string LeftJustify(string field, int len)
{
string retVal = string.empty;
///todo:
return retVal;
}
你能帮我把逻辑放在函数中吗?
请您参考如下方法:
如果你只是想填充字符串,你可以使用 String.PadRight直接:
private static string LeftJustify(string field, int len)
{
return field.PadRight(len);
}
