【发布时间】:2012-02-22 03:16:31
【问题描述】:
我有以下一行:
if ( dataGridView1.Rows[i].Cells[0].Value.ToString().Length >= 13 ){
e.Graphics.DrawString
(dataGridView1.Rows[i].Cells[0].Value.ToString().Substring(0,14),
print6B, Brushes.Black, x-10, 130 + height);
}
else {
由于 Substring 方法,我收到此错误: index 和 length 必须引用字符串 c# 中的某个位置
获取字符串前 14 个字符的最佳方法是什么?
【问题讨论】: