I am using ASP.NET with VB.NET.
This is my code
Dim Total As Double
Total = Convert.ToDouble(lblTotal.Text.Substring(4, 20))
The value of lblTotal is
ABC20.00
I just want to trim the value to give me the 20.00 and convert it ToDouble
End Result Must be
20.00
C# code will also help me undertand what needs to happen and why I am getting the error messsage
Index and length must refer to a location within the string. Parameter name: length
try
see http://msdn.microsoft.com/en-us/library/hxthx5h6.aspx
EDIT – as per comment:
The OP used in his example code 4 as starting index but the sample data would have to use 3 as starting index to achieve the result…