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