|
|
Нормализация строки : Значения типа "ПЕТРоВ" или "пеТроВ" в "Петров"
Public Function NormalString(vVal As Variant) As Variant
On Error GoTo NormalString_Err
Dim vRes As Variant
If InStr(1, vVal, "-") > 0 Then
vRes = Replace(vVal, "-", " - ")
vRes = StrConv(vRes, 3)
NormalString = Replace(vRes, " - ", "-")
Else
NormalString = StrConv(vVal, 3)
End If
NormalString_End:
On Error Resume Next
Exit Function
NormalString_Err:
NormalString = vVal
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure NormalString", vbCritical
Err.Clear
Resume NormalString_End
End Function
|
|