نقل قول نوشته شده توسط eb_1345 مشاهده تاپیک
لطفاً توابع پائین رو تست بفرمائین !

Public Function RemoveDupesInString(strText As String, Optional strDelim As String = " ") As String
Dim varArray As Variant
Dim intI As Integer
Dim strOut As String
strText = " " & strText & " "
varArray = Split(strText, strDelim)
For intI = 0 To UBound(varArray) - 1
If InStr(strOut, varArray(intI)) = 0 Then
strOut = strOut & varArray(intI) & " "
End If
Next
RemoveDupesInString = Trim(strOut)
End Function




Public Function DupesRegexp(StrReg As String)
Dim regx
Dim Matches As Object
Dim Match As Object
Dim Str As String
Set regx = CreateObject("VBScript.RegExp")
regx.Global = True
regx.IgnoreCase = True
regx.Multiline = True
regx.Pattern = "(\b\w+\b)(?=.*\b\1\b)"
Set Matches = regx.Execute(StrReg)
For Each Match In Matches
Str = Str & " " & Match.Value
Next
Str = Right(Str, Len(Str) - 1)
MsgBox RemoveDupesInString(Str)
End Function


Call DupesRegexp("Secure, smart, and easy to use email Get more done with Gmail. Now integrated with google Chat, Google Meet, and more, all in one place.")



سلام دوباره
گویا این کد برای پاک کردن موارد تکراری هست - که از پرسش اصلی پست 68 سختتره (فقط پیدا کردن تکراری ها)!
در نگاه اول کد زیر حالت خاص هست:
strText = " " & strText & " "