A function of the first character of the Chinese character string in PB

zhaozj2021-02-11  175

Today, I saw a function of Xuejun's first character. I tried it, I feel very easy, I don't dare to enjoy it. I will share it with you:

$ PBExportHeader $ uf_getfirstletter.srf $ PBExportComments $ string given back to the first letter of the string of characters, xuejun, 19990821global type uf_getfirstletter from function_objectend typeforward prototypesglobal function string uf_getfirstletter (string as_inputstring) end prototypesglobal function string uf_getfirstletter (string as_inputstring); // Function name: UF_GETFIRSTLETTER // USED TO: Returns the first alphanuger string of the Chinese character string, that is, the sound mother string // input arguments: as_inputstring - String, a given Chinese character // Return Value: ls_returnstring - String, a given Chinese character string Open-write // NOTICE: 1. This method is based on the effectiveness of Chinese characters of Chinese standard Chinese character library zone coding, which does not meet this code // system This function is invalid! // 2. If the Chinese characters contain non-Chinese characters, such as graphic symbols or ASCII codes, these non-Chinese characters // will remain unchanged .//sample: ls_rtn = uf_getfirstletter ("People's Republic") // Ls_RTN Will BE : zhrmghg // scripts: char lc_firstletter [23] // Start the starting area code of the national standard one-stage Chinese character to the pronunciation String ls_ch // Temporary unit string ls_secondsectable // store all national standard secondary Chinese character pronunciation String ls_returnstr // Return string Integer li_secposvalue [23] // Statement of the State-oriented Different Pronunciation of the Start Area Code Integer i, J Integer LI_SectorCode // Chinese Character Code Integer Li_Positioncode // Chinese Character Code Integer Li_SECPOSCODE // Chinese Zone Code Integer Li_offset // Level 2 Font Offset // SET Initial Valueli_secposValue [] = {1601, 1637, 1833, 2078, 2274, 2302, 3106, 3212, 372, 3635, 3722, 3730, 3858, 4027, 4086, 4390 4558, 4684, 4925, 5249} lc_firstletter [] = {"a", "b", "c", "d", "e", "f", "g", "h", "j", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T"

, "W", "x", "y", "z"} ls_secondsectable = "

CJWGNSPGCGNE [Y [BTYYZDXYKYGT [JNNJQMBSGZSCYJSYY [PGKBZGY [YWJKGKLJYWKPJQHY [W [DZLSGMRYPYWWCCKZNKYYGTTNJJNYKKZYTCJNMCYLQLYPYQF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GECLLKJLQJAQNBDKKGHPJTZQKSECSHALQFMMGJNLYJBBTMLYZXDCJPLDLPCQDHZYCBZSCZBZMSLJFLKRZJSNFRGJHXPDHYJYBZGDLQCSEZGXLBLGYXTWMABCHECMWYJYZLLJJYHLG [DJLSLYGKDZPZXJYYZLWCXSZFGWYYDLYHCLJSCMBJHBLYZLYCBLYDPDQYSXQZBYTDKYXJY [CNRJMPDJGKLCLJBCTBJDDBBLBLCZQRPPXJCJLZCSHLTOLJNMDDDLNGKAQHQHJGYKHEZNMSHRP [QQJCHGMFPRXHJGDYCHGHLYRZQLCYQJNZSQTKQJYMSZSWLCFQQQXYFGGYPTQWLMCRNFKKFSYYLQBMQAMMMYXCTPSHCPTXXZZSMPHPSHMCLMLDQFYQXSZYYDYJZZHQPDSZGLSTJBCKBXYQZJSGPSXQZQZRQTBDKYXZKHHGFLBCSMDLDGDZDBLZYYCXNNCSYBZBFGLZZXSWMSCCMQNJQSBDQSJTXXMBLTXZCLZSHZCXRQJGJYLXZFJPHYMZQQYDFQJJLZZNZJCDGZYGCTXMZYSCTLKPHTXHTLBJXJLX SCDQXCBBTJFQZFSLTJBTKQBXXJJLJCHCZDBZJDCZJDCPRNPQCJPFCZLCLZXZDMXMPHJSGZGSZZQLYLWTJPFSYASMCJBTZKYCWMYTCSJJLJCQLWZMALBXYFBPNLSFHTGJWEJJXXGLLJSTGSHJQLZFKCGNNNSZFDEQFHBSAQTGYLBXMMYGSZLDYDQMJJRGBJTKGDHGKBLQKBDMBYLXWCXYTTYBKMRTJZXQJBHLMHMJJZMQASLDCYXYQDLQCAFYWYXQHZ "// Get it! Ls_ReturnStr =" "For i = 1 to non Len (as_InputString) // sequentially processing each character as_InputString ls_ch = Mid (as_InputString, i, 1) If Asc (ls_ch) <128 then // Chinese characters ls_returnstr = ls_returnstr LS_CH // constant ELSE // is Chinese characters ls_ch = mid (as_inputstring, i, 2) // Remove this Chinese character li_sectorcode = ASC (Left (LS_CH, 1)) - 160 //

转载请注明原文地址:https://www.9cbs.com/read-5775.html

New Post(0)