Visual Basic Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



VB Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Unicode
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA


VB Strings
VB Byte Array

Unreleased...
Bzip2
LZW
Bz2
Icon

 

 

 

 

 

 

 

String Pattern Matching

This example explains how to do string pattern matching in Visual Basic.

' The Like operator pays attention to the current Option Compare setting.
' Setting it to text makes the pattern matching case-insensitive.
Option Compare Text
' Use Option Compare Binary for case-sensitive string pattern matching.
' Option Compare Binary


' The Like string operator provides string pattern matching in Visual Basic.
' * matches zero or more of any character.
' ? matches any single character.
' # matches any single digit.
' Match ranges of characters by enclosing the range in brackets:
'    [A-C] Matches any of A, B, or C
'    [ABC] Same as [A-C]
' Match characters not in a range by using !
'    [!A-Z]  Any character not including A-Z

Dim s As String
s = "Chilkat Software 1234 ABCD"

If s Like "*Software*" Then
    Print "Contains Software"
End If

If s Like "[!0-9]??*" Then
    ' Match any three characters such that the first cannot be a digit.
    Print "Matches!"
End If

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.