1
Dim amountorhour As String = "A4"
If amountorhour.Substring(0, 1) = "A" Then
amount = amountorhour.Substring(1, amountorhour.Length)--**error comes here**
HrsWorked = 0
Else
HrsWorked = amountorhour.Substring(1, amountorhour.Length - 1)
amount = 0
我知道这个错误显示出来,当我询问字符串的长度超出范围但在这种情况下,我没有看到类似的东西请帮助我弄清楚问题如何解决索引和长度必须引用字符串中的位置。参数名称:长度“?
感谢蒂姆,有一个参数重载方法的工作。 – user8811 2014-10-16 12:29:12