I'm sure there are better ways, but this seems to work :
VB Code:
Option Explicit
Private Sub Form_Load()
Dim S As String
Dim Ar() As String
Dim i As Integer
Dim j As Integer
Dim sNew As String
S = "5\5\5\10\10\15\15\5\10"
Ar = Split(S, "\")
For i = 0 To UBound(Ar)
For j = i + 1 To UBound(Ar)
If Ar(i) = Ar(j) Then
Ar(j) = vbNullString
End If
Next
Next
sNew = Join(Ar, "\")
Do While InStr(1, sNew, "\\")
sNew = Replace$(sNew, "\\", "\")
Loop
MsgBox sNew
End Sub
I don't know if you are coding in VBA, but this is VB6. You can take the whole form load code and make it a function and use it in your VBA code just as easily.