Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 4: Data, Operations, and Built-In Functions
Last change: February 13 2016 18:47:36.

4.5     String Data

As explained previously, a string consists of zero or more characters. The String data type is usually used to handle text such as names and addresses. It is also used for data code. For example, the characters M and F can be used to represent male and female. A string literal must be enclosed in a pair of quotes. String variables are used to store string data as shown in the following:

LastName = “Smith”

The code moves the string literal “Smith” to the variable named LastName. You can also assign data in a control or a variable to another variable. For example, the following code will assign to the variable LastName the text that the user has entered in the text box named txtLastName.

LastName = txtLastName.Text

Last change: February 13 2016 18:47:37.
  1. Mathematical Functions
  2. Conversion Functions
  3. Date/Time Functions
  4. Using Functions
  • 4.5 String Data
    1. Declaring String Variables
    2. String Operations and Built-In Functions
    3. The Calculating Vending Machine: An Example
    4. <<PreviousNext>>