How can convert this code....

May 18 2011 3:00 AM
Actually I convert this code into C#...


Function getpatcode()
Dim some = TextBox13.Text
Dim another As Integer
Dim newslip2 As String = "pat-0"
Dim number As String
another = CInt(some.TrimStart("p", "a", "t", "-"))
another += 1
number = another.ToString()
Return newslip2 + number
End Function

public object getpatcode()
{
dynamic some = TextBox13.Text;
int another = 0;
string newslip2 = "pat-0";
string number = null;
another = Convert.ToInt32(some.TrimStart("p", "a", "t", "-"));
another += 1;
number = another.ToString();
return newslip2 + number;
}

But some errors found.. Can anyone check this code?

Regards,



Answers (9)