
老师好, 一个六位数组成的点检序号,我想用第六位对应“作业区” 列 第五位和第四位 对应“点检区” 后三位对应“序号”
代码我是这样写的
Select Case e.DataCol.name
Case "点检序号"
If e.DataRow.IsNull("点检序号") = True Then
e.DataRow("作业区") = Nothing
e.DataRow("点检区") = Nothing
e.DataRow("序号") = Nothing
Else
e.DataRow("作业区") = GetDigit(e.DataRow("点检序号"),5)
e.DataRow("点检区") = GetDigit(e.DataRow("点检序号"),4) & GetDigit(e.DataRow("点检序号"),3)
e.DataRow("序号") = GetDigit(e.DataRow("点检序号"),2) & GetDigit(e.DataRow("点检序号"),1) & GetDigit(e.DataRow("点检序号"),0)
End If
End Select
这样写完之后 101001 分别对应 1 01 001 怎么才能将前面的0 去掉? 变成 1 1 1