|
|
Visual Basic
07 String Function Programs
Use the functions ucase(), lcase(), left(),
right(), mid(), chr(), asc() and len() to manipulate string variables.
Video Instruction
- Download the startup demo form.
- Basic functions len( ), ucase( ), lcase( )
- Basic functions left( ), right( ), mid( ) - Part 1, Part 2
- Basic functions chr( ) to add special characters.
- Writing the individual characters of a string to a label.
- Finding a character in a string.
- Writing a string in reverse order.
- Using the kepress function - Part 1, Part 2
- Final test of all functions.
Write all programs on one form using option buttons in a frame
for each program. Use input boxes when inputting data. Save the program using
our traditional naming system as 07_xxx_str.frm.
- Input a word and a character. Determine at
what position the character exists in the word (if it exists). For
example, if the word "Lincoln" is entered with the character "o",
the output would note that at "o" is at position 5.
- Input a name in "fname lname" format and
output the name in "LNAME, FNAME" format. Example "Barnie Rubble"
would be outputted as "RUBBLE, BARNIE".
- Enter a word and determine which positions a
vowel occupies.
- Enter a sentence. Print the individual words
of the sentence.
- Determine if a word is a palindrome.
Palindromes are words which are spelled the same way forwards or
backwards. The word "racecar" would be an example of a palindrome
as it is spelled the same whether you read from the left or from
the right.
- Enter two words and determine if the two words
are the same if case is disregarded.
- Use the keypress function to press a key on the keyboard. Determine if the key is an uppercase, lower case, numeric key, or non-alphanumeric.
Visual Basic Assignment
Page
|
|