再修正一个小小的BUG,当Sep的长度>1时,返回值的最后会出现多了一些连接字符,原因为: Public Function GetPinYin(HzStr As String) As String Dim I As Integer Dim tmpStr As String GetPinYin = "" If HzStr <> "" Then If pvUseSeperator Or pvInitialOnly Then For I = 1 To Len(HzStr) tmpStr = IFELanguage_GetMorphResult(Mid(HzStr, I, 1)) If tmpStr <> "" Then If pvInitialOnly Then GetPinYin = GetPinYin & GetInitial(tmpStr) & pvSeperator Else GetPinYin = GetPinYin & tmpStr & pvSeperator End If End If Next If Len(GetPinYin) > 0 Then GetPinYin = Left(GetPinYin, Len(GetPinYin) - Len(pvSeperator)) '原来红色的部份为1,这样只去除了最后一个字符!应该为pvSeperator(即Step)的长度! Else GetPinYin = IFELanguage_GetMorphResult(HzStr) End If End If End Function
[此贴子已经被作者于2008-7-23 17:24:56编辑过] |