April 20, 2009

0 String Operator

A string is most often text, for example "HelloWorld". To stick two or more string variables together, use the + operator.

txt1= "What a very"
txt2= "nice day!"
txt3=txt1+txt2

The variable txt3 now contains "What a verynice day!"

To add a space between two string variables, insert a space into the expression, OR in one of the strings.

txt1= "What a very"
txt2= "nice day!"
txt3=txt1+" " +txt2


or
txt1= "What a very"
txt2= "nice day!"
txt3=txt1+txt2


The variable txt3 now contains "What a very nice day!"

0 comments:

Post a Comment

Blogger Themes

 
Powered by Blogger