博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
将中文数字转换层阿拉伯数字
阅读量:5151 次
发布时间:2019-06-13

本文共 2444 字,大约阅读时间需要 8 分钟。

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

 

转载于:https://www.cnblogs.com/pyblogs/p/3492252.html

你可能感兴趣的文章
HDU 6370(并查集)
查看>>
BZOJ 1207(dp)
查看>>
HDU 2076 夹角有多大(题目已修改,注意读题)
查看>>
洛谷P3676 小清新数据结构题(动态点分治)
查看>>
九校联考-DL24凉心模拟Day2T1 锻造(forging)
查看>>
Attributes.Add用途与用法
查看>>
L2-001 紧急救援 (dijkstra+dfs回溯路径)
查看>>
javascript 无限分类
查看>>
spring IOC装配Bean(注解方式)
查看>>
[面试算法题]有序列表删除节点-leetcode学习之旅(4)
查看>>
SpringBoot系列五:SpringBoot错误处理(数据验证、处理错误页、全局异常)
查看>>
kubernetes_book
查看>>
OpenFire 的安装和配置
查看>>
侧边栏广告和回到顶部
查看>>
https://blog.csdn.net/u012106306/article/details/80760744
查看>>
海上孤独的帆
查看>>
处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“Manag
查看>>
01: socket模块
查看>>
mysql触发器
查看>>
淌淌淌
查看>>