|
1 members (Russ),
10,950
guests, and
1,516
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
S |
M |
T |
W |
T |
F |
S |
|
|
|
1
|
2
|
3
|
4
|
5
|
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
|
13
|
14
|
15
|
16
|
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
This is another custom island. This one could be used for ads. This spot is one of the best places for ads on your site to be placed. This can be enabled/disabled on a per forum basis.
|
|
|
|
Joined: Dec 1999
Posts: 30,868
Master Elite Member
|
Public Function String_PurgeDups(MyString As String, CaseSens As Boolean) As String
'Purpose
' Used to remove duplicate characters from a string.
'Parameters
' MyString (String) = The string we're working with.
' CaseSens (Boolean) = If True, characters are only considered duplicates if they match case.
' If False, characters are considered duplicates even if they don't match case.
'Return (String)
' Returns MyString with all duplicate characters removed.
' Returns a zero-length string if:
' MyString is zero-length.
'Dependencies
' String_CountChar()
'Version History
' 1.0 3/27/2006 3:20am Tested by Russ Tanner on VB 6 Win 2000
'---
'Initiate variables
Dim i As Long 'index into MyString
Dim R As String 'return buffer
'Traverse all characters in MyString
For i = 1 To Len(MyString)
'The current character has no duplicates, append it to the return string
If String_CountChar(R, Mid(MyString, i, 1), CaseSens) = 0 Then R = R & Mid(MyString, i, 1)
Next i
'Return the result
String_PurgeDups = R
End Function
|
|
|
|
|