Visual Basic
07 String Function Programs

Use the functions ucase(), lcase(), left(), right(), mid(), chr(), and len() to manipulate string variables.

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 07xxxstr.frm.

  1. 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.
  2. Input a name in "fname lname" format and output the name in "LNAME, FNAME" format. Example "Barnie Rubble" would be outputted as "RUBBLE, BARNIE".
  3. Enter a word and determine which positions a vowel occupies.
  4. Enter a sentence. Print the individual words of the sentence.
  5. 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.
  6. Enter two words and determine if the two words are the same if case is disregarded.
  7. 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

 
51836

 

 
© 2004-2008, Jerel L. Welker
Page Updated: January 15, 2009