Public Function DOIFONT(st As String) As String
Const codau = A¢¡©Ê¨¹¸µ¶¾»Æ·½ÉËÇßãäâèåéç¬îêíì«æôòóïñùøõ÷öÑÏÐ̪ÖÕÒÔÓ®×ÞÝÜûýþü§®
Const khongdau = AAAaaaaaaaaaaaaaaaooooooooooooooouuuuuuuuuuueeeeeeeeeediiiiyyyydd
Dim vt As Byte Dim TAM As String
Dim Ch As String * 1
st = Trim(st) If Len(st) = 0 Then
DOIFONT =
Exit Function
End If
st = & st TAM =
While Len(st) > 0
Ch = Left(st, 1)
st = Right(st, Len(st) - 1)
If Ch = Then st = Trim(st)
If (Right(TAM, 1) = ) Or (Right(TAM, 1) = .) Or (Right(TAM, 1) = () Or _ (Right(TAM, 1) = +) Or (Right(TAM, 1) = -) Then vt = InStr(1, khongdau, Ch) If vt <> 0 Then Ch = Mid(codau, vt, 1)
If Ch = § Or Ch = ® Then Ch = D TAM = TAM + Ch
Else vt = InStr(1, codau, Ch) If vt <> 0 Then Ch = Mid(khongdau, vt, 1)
If Ch = § Or Ch = ® Then Ch = D
TAM = TAM + Ch
End If
Wend
DOIFONT = Right(TAM, Len(TAM) - 1)
End Function |