String variableName = value;

*******************************************************
How to declare and initialize a string

String message1 = "Invalid data entry";
String message2 = "";
String message3 = null;

*******************************************************
How to join strings

Sting  firstName = "Bob";
String lastName  = "Smith";
String name      = firstName + " " + lastName;


*******************************************************
how to join a string with a number

double price = 14.34;
String priceString = "Price: " + price;


*******************************************************
how to append one string to another with the + operator

firstName = "Bob";
lastName  = "Smith";
name      = firstName + "";
name      = name + lastName;

or

name     += lastName;

*******************************************************




Site hosted by Angelfire.com: Build your free website today!