在excel中實現漢字轉換拼音首字母大寫

2021-09-11 07:57:30 字數 3295 閱讀 3949

分享一下我老師大神的人工智慧教程。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智慧的隊伍中來!

在excel 2003和2007中已經驗證成功。**為網上收集,原作者已不可考。

function getpychar(char)tmp = 65536 + asc(char)if (tmp >= 45217 and tmp <= 45252) thengetpychar = "a"elseif (tmp >= 45253 and tmp <= 45760) thengetpychar = "b"elseif (tmp >= 45761 and tmp <= 46317) thengetpychar = "c"elseif (tmp >= 46318 and tmp <= 46825) thengetpychar = "d"elseif (tmp >= 46826 and tmp <= 47009) thengetpychar = "e"elseif (tmp >= 47010 and tmp <= 47296) thengetpychar = "f"elseif (tmp >= 47297 and tmp <= 47613) thengetpychar = "g"elseif (tmp >= 47614 and tmp <= 48118) thengetpychar = "h"elseif (tmp >= 48119 and tmp <= 49061) thengetpychar = "j"elseif (tmp >= 49062 and tmp <= 49323) thengetpychar = "k"elseif (tmp >= 49324 and tmp <= 49895) thengetpychar = "l"elseif (tmp >= 49896 and tmp <= 50370) thengetpychar = "m"elseif (tmp >= 50371 and tmp <= 50613) thengetpychar = "n"elseif (tmp >= 50614 and tmp <= 50621) thengetpychar = "o"elseif (tmp >= 50622 and tmp <= 50905) thengetpychar = "p"elseif (tmp >= 50906 and tmp <= 51386) thengetpychar = "q"elseif (tmp >= 51387 and tmp <= 51445) thengetpychar = "r"elseif (tmp >= 51446 and tmp <= 52217) thengetpychar = "s"elseif (tmp >= 52218 and tmp <= 52697) thengetpychar = "t"elseif (tmp >= 52698 and tmp <= 52979) thengetpychar = "w"elseif (tmp >= 52980 and tmp <= 53640) thengetpychar = "x"elseif (tmp >= 53689 and tmp <= 54480) thengetpychar = "y"elseif (tmp >= 54481 and tmp <= 62289) thengetpychar = "z"else '如果不是中文,則不處理getpychar = charend ifend functionfunction getpy(str)for i = 1 to len(str)getpy = getpy & getpychar(mid(str, i, 1))next iend function

分享一下我老師大神的人工智慧教程。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智慧的隊伍中來!

在excel 2003和2007中已經驗證成功。**為網上收集,原作者已不可考。

function getpychar(char)tmp = 65536 + asc(char)if (tmp >= 45217 and tmp <= 45252) thengetpychar = "a"elseif (tmp >= 45253 and tmp <= 45760) thengetpychar = "b"elseif (tmp >= 45761 and tmp <= 46317) thengetpychar = "c"elseif (tmp >= 46318 and tmp <= 46825) thengetpychar = "d"elseif (tmp >= 46826 and tmp <= 47009) thengetpychar = "e"elseif (tmp >= 47010 and tmp <= 47296) thengetpychar = "f"elseif (tmp >= 47297 and tmp <= 47613) thengetpychar = "g"elseif (tmp >= 47614 and tmp <= 48118) thengetpychar = "h"elseif (tmp >= 48119 and tmp <= 49061) thengetpychar = "j"elseif (tmp >= 49062 and tmp <= 49323) thengetpychar = "k"elseif (tmp >= 49324 and tmp <= 49895) thengetpychar = "l"elseif (tmp >= 49896 and tmp <= 50370) thengetpychar = "m"elseif (tmp >= 50371 and tmp <= 50613) thengetpychar = "n"elseif (tmp >= 50614 and tmp <= 50621) thengetpychar = "o"elseif (tmp >= 50622 and tmp <= 50905) thengetpychar = "p"elseif (tmp >= 50906 and tmp <= 51386) thengetpychar = "q"elseif (tmp >= 51387 and tmp <= 51445) thengetpychar = "r"elseif (tmp >= 51446 and tmp <= 52217) thengetpychar = "s"elseif (tmp >= 52218 and tmp <= 52697) thengetpychar = "t"elseif (tmp >= 52698 and tmp <= 52979) thengetpychar = "w"elseif (tmp >= 52980 and tmp <= 53640) thengetpychar = "x"elseif (tmp >= 53689 and tmp <= 54480) thengetpychar = "y"elseif (tmp >= 54481 and tmp <= 62289) thengetpychar = "z"else '如果不是中文,則不處理getpychar = charend ifend functionfunction getpy(str)for i = 1 to len(str)getpy = getpy & getpychar(mid(str, i, 1))next iend function

漢字轉換拼音函式

呼叫convertpinyin 函式,引數為你要轉換的漢字 返回值就是轉換後的拼音 可以只返回首字母或者首字母大寫的全拼拼音 var phonetictranscriptionobj 漢字轉拼音 function convertpinyin chinesecharacter else if name...

漢字轉換拼音函式

呼叫convertpinyin 函式,引數為你要轉換的漢字 返回值就是轉換後的拼音 可以只返回首字母或者首字母大寫的全拼拼音 var phonetictranscriptionobj 漢字轉拼音 function convertpinyin chinesecharacter else if name...

漢字轉換成拼音

c 乙個有用的漢字轉拼音類 c 漢字轉換為拼音的類,含大小寫轉換 因為是靜態函式 呼叫方法很簡單 crazycoderpinyin.convert 瘋狂 如下 using system using system.collections.generic using system.text using ...