I have some vb code i would find it helpful if someone was able to convert it to c# for me. I dont really know what the left function does?
If Left(cboLeng, 1) = "1" And Left(cboLeng, 1) = "2" And Left(cboLeng, 1) = "3" And Left(cboLeng, 1) = "4" And Left(cboLeng, 1) = "5" And Left(cboLeng, 1) = "6" And Left(cboLeng, 1) = "7" And Left(cboLeng, 1) = "8" And Left(cboLeng, 1) = "9" Then
Leng = "L" & cboLeng.Text
Else
Leng = cboLeng.Text
End If
(It’s not clear what
cboLengis here, by the way – it looks like it’s being used as a string and a type which contains aTextproperty. More information would help. The rest of this answer assumes it’s a string – otherwise, just use theTextproperty once to get the string value, and operate on that.)The
Leftfunction takes an initial substring – but that code doesn’t make sense. It’s sort of equivalent to:A string can’t start with “1” and start with “2”. My guess is it really wants to be something like: