back up codes

always have a backup of your code

Archive for the tag “filter”

filter function

The Filter function returns a zero-based array containing a subset of a string array based on specified filter criteria.


Dim myString() As String
Dim theString(2) As String
theString(0) = "This"
theString(1) = "Is"
theString(2) = "It"
myString = Filter(theString, "is", True, CompareMethod.Text)
myString = Filter(theString, "is", True, CompareMethod.Binary)
myString = Filter(theString, "is", False, CompareMethod.Binary)

First filter will result “This”, “Is”.
Second filter will return “This”.
Third filter will return “Is”, “It”.

limit display to certain number of characters

The following function will limit the display of characters to certain number:


Function limitmyChars(ByVal myString As String, ByVal myCharNumber As Integer) As String
If myString.Length > myCharNumber Then
myString = Left((myString).ToString(), myCharNumber) & "..."
End If
Return myString
End Function

Post Navigation

Follow

Get every new post delivered to your Inbox.