powershell 汉字转拼音
来源:互联网 发布:java做音乐管理系统 编辑:程序博客网 时间:2024/05/22 02:01
add-type -path "C:\Program Files (x86)\Microsoft Visual Studio International Pack\Simplified Chinese Pin-Yin Conversion Library\ChnCharInfo.dll"$inputtxt="北京欢迎您!"$shortR=""$allR=""foreach($c in $inputtxt.Trim().ToCharArray()){try {$chineseChar=New-Object Microsoft.International.Converters.PinYinConverter.ChineseChar($c)$shortR+=$chineseChar.Pinyins[0].Substring(0, 1).ToLower() $allR += $chineseChar.Pinyins[0].Substring(0,$chineseChar.Pinyins[0].Length - 1).ToLower() }catch {$shortR+=$c$allR +=$c}}$shortR$allR
运行结果:
bjhyn!
beijinghuanyingnin!
0 0
- powershell 汉字转拼音
- powershell 下汉字转拼音
- 汉字转换为拼音 - Powershell
- 汉字转拼音
- 汉字转拼音缩写
- 汉字转拼音缩写
- 实用汉字转拼音
- 汉字转拼音
- 汉字转拼音 asp
- 汉字转拼音缩写
- 汉字转拼音
- 汉字转拼音缩写
- 汉字转拼音
- PHP汉字转拼音
- PHP汉字转拼音
- php汉字转拼音
- java 汉字转拼音
- 汉字转拼音(C#)
- String.prototype.trim= function(){ return this.replace(/(^\s*)|(\s*$)/g, ""); };
- ResultSet
- 用sql语句实现年龄分段统计
- easyui验证扩展
- 在CordovaActivity中添加原生View组件
- powershell 汉字转拼音
- libevent代码阅读(5)——“hello-world.c”之 event_base对象的创建
- linux下c/c++实例之六时间测试和定时器
- Qt 备忘录
- play framework 2.0 实战(2)-Ebean
- MFC中的数据类型
- 正则表达式和字符串处理
- oracle函数大全-字符串处理函数
- php.ini上传大文件的配置