Hi All
I'm new here and I hope you help me
I have a code to find a certain letter in Arabic and replace it with another letter
my code finds every letter ( أ , إ , آ ) and replace it with ( ا )
the problem is that the code replaces every letter in the text and what I need is to replace the first letter only if it 's one of those assigned letters
Here's my code
any help 'd be highly appreciated
I'm new here and I hope you help me
I have a code to find a certain letter in Arabic and replace it with another letter
my code finds every letter ( أ , إ , آ ) and replace it with ( ا )
the problem is that the code replaces every letter in the text and what I need is to replace the first letter only if it 's one of those assigned letters
Here's my code
Code:
Public Function changesearch(Mytxt) As String
Dim tempstr As String
tempstr = Trim(Mytxt)
If tempstr Like "*[أاآإ]*" Then
For b = 1 To Len(tempstr)
If Mid(tempstr, b, 1) = "ا" Or Mid(tempstr, b, 1) = "إ" Or Mid(tempstr, b, 1) = "أ" Or Mid(tempstr, b, 1) = "آ" Then
Mid(tempstr, b, 1) = "ا"
Else
End If
Next
End If
changesearch = tempstr
End Function