1 Private Sub ChangeChineseNumberToArabicNumber() 2 Dim TempSubName As String = "" 3 TempSubName = "第三分公司" 4 'TempSubName = "第十分公司" 5 'TempSubName = "第十三分公司" 6 'TempSubName = "第五十分公司" 7 'TempSubName = "第二十五分公司" 8 'TempSubName = "第五百分公司" 9 'TempSubName = "第七百零六分公司"10 'TempSubName = "第六百一十分公司"11 'TempSubName = "第八百八十八分公司"12 13 TempSubName = Replace(TempSubName, "零", "0")14 TempSubName = Replace(TempSubName, "一", "1")15 TempSubName = Replace(TempSubName, "二", "2")16 TempSubName = Replace(TempSubName, "三", "3")17 TempSubName = Replace(TempSubName, "四", "4")18 TempSubName = Replace(TempSubName, "五", "5")19 TempSubName = Replace(TempSubName, "六", "6")20 TempSubName = Replace(TempSubName, "七", "7")21 TempSubName = Replace(TempSubName, "八", "8")22 TempSubName = Replace(TempSubName, "九", "9")23 TempSubName = Replace(TempSubName, "十", "T")24 TempSubName = Replace(TempSubName, "百", "H")25 26 '处理"十"位27 If System.Text.RegularExpressions.Regex.IsMatch(TempSubName, "\dT\d") Then28 TempSubName = Replace(TempSubName, "T", "")29 ElseIf System.Text.RegularExpressions.Regex.IsMatch(TempSubName, "T\d") Then30 TempSubName = Replace(TempSubName, "T", "1")31 ElseIf System.Text.RegularExpressions.Regex.IsMatch(TempSubName, "\dT") Then32 TempSubName = Replace(TempSubName, "T", "0")33 Else34 TempSubName = Replace(TempSubName, "T", "10")35 End If36 37 '处理"百"位38 If System.Text.RegularExpressions.Regex.IsMatch(TempSubName, "\dH\d") Then39 TempSubName = Replace(TempSubName, "H", "")40 ElseIf System.Text.RegularExpressions.Regex.IsMatch(TempSubName, "H\d") Then41 TempSubName = Replace(TempSubName, "H", "1")42 ElseIf System.Text.RegularExpressions.Regex.IsMatch(TempSubName, "\dH") Then43 TempSubName = Replace(TempSubName, "H", "00")44 Else45 TempSubName = Replace(TempSubName, "H", "100")46 End If47 48 Response.Write(TempSubName)49 End Sub