取得字符串首字母

原创 2004年09月07日 06:34:00

'Code By 魑魅魍魉
'mailto:DemonStudio@hotmail.com

Private Function PYin(ByVal Str As String) As String
Dim mLen As Long, mLong As Long, PY As String
mLen = Len(Str)
For mLong = 1 To mLen
Select Case Asc(Mid$(Str, mLong, 1))
Case -20319 To -20284:  PY = "A"
Case -20283 To -19776:  PY = "B"
Case -19775 To -19219:  PY = "C"
Case -19218 To -18711:  PY = "D"
Case -18710 To -18527:  PY = "E"
Case -18526 To -18240:  PY = "F"
Case -18239 To -17923:  PY = "G"
Case -17922 To -17418:  PY = "H"
Case -17417 To -16475:  PY = "J"
Case -16474 To -16213:  PY = "K"
Case -16212 To -15641:  PY = "L"
Case -15640 To -15166:  PY = "M"
Case -15165 To -14923:  PY = "N"
Case -14922 To -14915:  PY = "O"
Case -14914 To -14631:  PY = "P"
Case -14630 To -14150:  PY = "Q"
Case -14149 To -14091:  PY = "R"
Case -14090 To -13319:  PY = "S"
Case -13318 To -12839:  PY = "T"
Case -12838 To -12557:  PY = "W"
Case -12556 To -11848:  PY = "X"
Case -11847 To -11056:  PY = "Y"
Case -11055 To -2050:   PY = "Z"
End Select
PYin = PYin & PY
Next mLong
End Function

 

Private Sub Text1_Change()
Me.Caption = PYin(Text1)
End Sub

dev c++4.9.9.2

  • 2009年09月01日 17:50
  • 8.9MB
  • 下载

DEV C++4.9.9.2中文版

  • 2010年04月24日 13:04
  • 9.51MB
  • 下载

//获取某个字符串或者汉字的首字母.

//获取某个字符串或者汉字的首字母. - (NSString *)firstCharactorWithString:(NSString *)string {     NSMutabl...
  • apple_bao
  • apple_bao
  • 2017-06-21 16:49:11
  • 169

字符串获取字符串的首字母

/**  * 取得给定汉字串的首字母串,即声母串  * Title: ChineseCharToEn  * @date 注:只支持GB2312字符集中的汉字  */   public...
  • qq_26566125
  • qq_26566125
  • 2017-07-07 14:33:49
  • 126

java中英文获取首字母

package com.syz; /** * @author shiyz * @creation date 2012-10-25 上午11:01:34 * */ public class GB...
  • shiyuezhong
  • shiyuezhong
  • 2012-10-25 12:07:07
  • 9533

取得字符串首字母

Code By 魑魅魍魉mailto:DemonStudio@hotmail.comPrivate Function PYin(ByVal Str As String) As StringDim mL...
  • DemonLoveLizzy
  • DemonLoveLizzy
  • 2004-09-07 06:34:00
  • 986

vb字符串操作

1 VBA中的字符串 VBA不仅可以处理数字,也可以处理文本(字符串)。VBA提供了两类字符串: 一类为固定长度的字符串,声明时包含指字的字符数。例如,下面的语句 Dim strFixedLon...
  • rzhpq
  • rzhpq
  • 2015-03-05 09:24:02
  • 2003

汉字转拼音 (转首字母)

  • 2009年04月08日 15:17
  • 33KB
  • 下载

java实现读取汉字的首字母

  • 2012年01月30日 08:33
  • 12KB
  • 下载

vb.net获取汉字首字母

 返回给定字符串的首字母Private Function IndexCode(ByVal IndexTxt As String) As String    Dim i As Integer    Fo...
  • lvzenghui
  • lvzenghui
  • 2010-04-20 09:34:00
  • 1387
收藏助手
不良信息举报
您举报文章:取得字符串首字母
举报原因:
原因补充:

(最多只允许输入30个字)