|
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 SArr_PurgeStr(SArray() As String, MyString As String, CaseSen As Boolean) As String()
'Function
' Removes all instances of a specified string (MyString) from a string array (SArray).
'Parameters
' SArray (String()) = The array to filter.
' MyString (String) = The string to remove from SArray.
' CaseSen (Boolean) = If True, the comparison is case-sensitive.
' If False, the comparison is not case-sensitive.
'Return
' Returns a string array containing all the elements in SArray except any elements that match MyString.
' Returns an empty array if:
' SArray is empty.
' Returns all the elements in SArray if:
' MyString is not found in SArray.
'Version History
' 1.0 4/1/2006 8am Tested by Russ Tanner on VB6 Win2000
'---
'Initiate variables
Dim i As Long 'index into SArray
Dim R() As String 'return buffer
'Trap: The source array is empty, always return an empty array
If ElementCount(SArray) = 0 Then
SArr_PurgeStr = R
Exit Function
End If
'Loop though all elements in SArray...
'The search is case-sensitive
If CaseSen Then
For i = LBound(SArray) To UBound(SArray)
'Match not found, append this element to the return buffer
If SArray(i) <> MyString Then
ReDim Preserve R(ElementCount(R))
R(UBound(R)) = SArray(i)
End If
Next i
'The search is not case-sensitive
Else
For i = LBound(SArray) To UBound(SArray)
'Match not found, append this element to the return buffer
If UCase(SArray(i)) <> UCase(MyString) Then
ReDim Preserve R(ElementCount(R))
R(UBound(R)) = SArray(i)
End If
Next i
End If
'Return the result
SArr_PurgeStr = R
End Function
|
|
|
|
|