这是我的 vb.net 代码:
Private Function PartOK(ByVal sPart As String) As Boolean
Dim sCheck As String
sCheck = "1234567890"
PartOK = False
sPart = Trim(sPart)
If (Len(sPart) = PART_LENGTH) Or (IsNumeric(sPart)) Then
Select Case sPart
Case New String("1", PART_LENGTH), New String("2", PART_LENGTH), New String("3", PART_LENGTH)
Case New String("4", PART_LENGTH), New String("5", PART_LENGTH), New String("6", PART_LENGTH)
Case New String("7", PART_LENGTH), New String("8", PART_LENGTH), New String("9", PART_LENGTH)
Case New String("0", PART_LENGTH), Left(sCheck, PART_LENGTH), Left(StrReverse(Left(sCheck, PART_LENGTH)), PART_LENGTH)
Case Else : PartOK = True
End Select
End If
End Function
这个函数我转换成c#。但我不明白开关盒。
你们能解释一下吗?