首页 > 其他分享 >ACCESS 汉字转成拼音首字母

ACCESS 汉字转成拼音首字母

时间:2023-10-12 16:44:21浏览次数:33  
标签:Case ChrW 拼音 HZtoPY ACCESS 首字母 strHZ HZ

'拼音首字母
Public Function HZtoPY(ByVal strHZ As String) As String
    Dim i As Integer, intCountHZ As Integer
    Dim HZ As String

    strHZ = Trim(strHZ)
    intCountHZ = Len(strHZ)
    HZtoPY = ""

    For i = 1 To intCountHZ
        HZ = Mid(strHZ, i, 1)
        Select Case ChrW(AscW(HZ))
        Case ChrW(&H5416) To ChrW(&H93CA): HZtoPY = HZtoPY & "A"
        Case ChrW(&H516B) To ChrW(&H7C3F): HZtoPY = HZtoPY & "B"
        Case ChrW(&H5693) To ChrW(&H9519): HZtoPY = HZtoPY & "C"
        Case ChrW(&H54D2) To ChrW(&H8DFA): HZtoPY = HZtoPY & "D"
        Case ChrW(&H5C59) To ChrW(&H8D30): HZtoPY = HZtoPY & "E"
        Case ChrW(&H53D1) To ChrW(&H99A5): HZtoPY = HZtoPY & "F"
        Case ChrW(&H65EE) To ChrW(&H8FC7): HZtoPY = HZtoPY & "G"
        Case ChrW(&H94EA) To ChrW(&H8816): HZtoPY = HZtoPY & "H"
            '''' "I"  -- ?;T;
        Case ChrW(&H4E0C) To ChrW(&H7AE3): HZtoPY = HZtoPY & "J"
        Case ChrW(&H5494) To ChrW(&H5ED3): HZtoPY = HZtoPY & "K"
        Case ChrW(&H5783) To ChrW(&H96D2): HZtoPY = HZtoPY & "L"
        Case ChrW(&H5988) To ChrW(&H7A46): HZtoPY = HZtoPY & "M"
        Case ChrW(&H62FF) To ChrW(&H7CEF): HZtoPY = HZtoPY & "N"
        Case ChrW(&H5662) To ChrW(&H6CA4): HZtoPY = HZtoPY & "O"
        Case ChrW(&H8DB4) To ChrW(&H66DD): HZtoPY = HZtoPY & "P"
        Case ChrW(&H4E03) To ChrW(&H7FA4): HZtoPY = HZtoPY & "Q"
        Case ChrW(&H86BA) To ChrW(&H7BAC): HZtoPY = HZtoPY & "R"
        Case ChrW(&H7BAC) To ChrW(&H9501): HZtoPY = HZtoPY & "S"
        Case ChrW(&H4ED6) To ChrW(&H7BA8): HZtoPY = HZtoPY & "T"
            '''' "U"  -- ?;T;
            '''  "V"  -- ?;T;
        Case ChrW(&H54C7) To ChrW(&H92C8): HZtoPY = HZtoPY & "W"
        Case ChrW(&H5915) To ChrW(&H8548): HZtoPY = HZtoPY & "X"
        Case ChrW(&H8548) To ChrW(&H8574): HZtoPY = HZtoPY & "Y"
        Case ChrW(&H531D) To ChrW(&H505A): HZtoPY = HZtoPY & "Z"
        Case Else
            HZtoPY = HZtoPY & HZ
        End Select
    Next
End Function

调用 :

?HZtoPY("平刀")
'PD'

 

标签:Case,ChrW,拼音,HZtoPY,ACCESS,首字母,strHZ,HZ
From: https://www.cnblogs.com/yoooos/p/17759848.html

相关文章

  • 百度资源搜索平台出现:You do not have the proper credential to access this page.怎
    ForbiddensitenotallowedYoudonothavethepropercredentialtoaccessthispage.Ifyouthinkthisisaservererror,pleasecontactthewebmaster.如果你的百度资源平台,点进去出现这个提示,说明您的网站已经被百度清退了。如果你的网站被清退了,网站可能会出现关键词,收......
  • 什么是Apache Access Log中的OPTIONS *的含义
    访问日志在Apache的AccessLog中会看到很多如下的访问日志:127.0.0.1--[05/May/2011:10:54:07+0800]"OPTIONS*HTTP/1.0"200-127.0.0.1--[05/May/2011:10:54:08+0800]"OPTIONS*HTTP/1.0"200-127.0.0.1--[05/May/2011:10:54:09+0800]"OPTIONS......
  • 背单词 首字母 2023年10月
    2023-10-07tspusmspgotedpttar,slay,pilgrim,utmost,satirical,misapprehension,scorn,paddle,groom,occasion,tuberculosis,exclamation,drum,pager,turnip2023-10-06cscaffhdphsciamcircus,syndrome,claw,administrate,foam,fretful,harry,drugstore,pe......
  • access
    access函数是C语言标准库中的一个函数,用于检查文件是否可以访问。函数原型intaccess(constchar*path,intmode);path:要检查的文件或目录的路径。mode:指定操作的方式,可以是以下值之一:F_OK:用于检查文件是否存在。R_OK:用于检查文件是否可读。W_OK:用于检查文件是否......
  • java中如何对特大文件做断点续传RandomAccessFile
    Java中可以使用 RandomAccessFile 类来实现特大文件的断点续传功能。importjava.io.File;importjava.io.IOException;importjava.io.RandomAccessFile;importjava.net.URL;importjava.net.HttpURLConnection;publicclassResumeDownloadExample{publicstaticvoi......
  • Java生成6位随机数(数字和拼音)Demo
    publicstaticvoidmain(String[]args){//length=6生成的位数intlength=6;StringBuffersb=newStringBuffer();StringALLCHAR="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";Randomrandom=newRandom();f......
  • 手工升级ACCESS到SQLSERVER
    1、必须先安装MicrosoftOfficeAccess2003,和SQLServer2000。 2、把旧的数据库备份,备份完成后,用Access2003打开MDB数据库,在打开时会出现一个警告,不要理会它(安全警告),按打开键,打开后按工具栏——数据库实用工具——转换数据库——转换为2002-2003格式,把数据库转换成2003格式......
  • ACCESS 报表分页-指定显示固定行数
    在报表中插入三个无关联的文本框控件,取名分别为Text,Text2,Text3,他们的宽/高,上/左边距按需求自定义,可见均设置为否,如果你需要显示序号的话,text3可设置为可见text 控件来源:=1text2:控件来源: =IIf([Text]<[Text3]+1,[Text],IIf(([Text]Mod[Text3])=0,[Text3],([Text......
  • 堡垒机AccessClient插件在Mac苹果电脑闪退,已解决
    我的配置:Macmini,AppleM2,MacOS版本13.4(22F66)先来总结我的方案:1.安装Python3;2.修改main.scpt并生效;3.看指定输出的日志提示什么;4.最后需要安装MicrosoftRemoteDesktopforMac。最初的解决方案:https://www.zhihu.com/question/435060483改了日志输出位置,查看日志,找不对具......
  • 关于 Failed to bind properties under 'sky.alioss.access-key-id' to java.lang.Str
    问题描述废话不多说,上截图解决方案问题出现的原因:因为自己没有按照格式去运行程序,在yml中把他们得位置向前一个单位就解决问题了......