Lesson 11: String Manipulation Flashcards
represents a series of characters (each representing in turn an instance of the Chardata type).
STRING IN VISUAL BASIC
if you declare a string
variable using the ‘Dim’ keyword and initialize it
with a string value, it enclosed in double quotes
Declaring and Initializing
a property (or treating the string as an array)
Chars
a property that returns the number of characters in the
string
Length
used to compare two strings and return an integer that indicates the result of the comparison.
THE STRCOMP FUNCTIONS
Performs a case-sensitive comparison.
vbBinaryCompare:
Performs a case-insensitive comparison.
vbTextCompare:
returns an integer value which is the length of a
phrase or a sentence, including the empty spaces. The syntax is
Len (Phrase).
The Len function
trims the empty spaces of the left portion
of the phrase.
The Ltrim function
trims the empty spaces of the right
portion of the phrase
The Rtrim function
Removes whitespace or other predefined characters from
both sides of a string.
THE TRIM FUNCTION
extracts a
substring from the original phrase
or string. The syntax is:
Mid(phrase, position, n).
The Mid function
looks for a phrase that is embedded
within the original phrase and returns the starting position
of the embedded phrase.
The InStr function
converts all the characters of a string to capital
letters.
The Ucase function
converts all the characters of
a string to small letters.
the Lcase function