- How to concatenate strings
  - The Program:
  - The Code:
  - The Source

# How to concatenate strings

You can concatenate strings by using this syntax : "xxx" & "yyy"

## The Program:

You can create a program with a text box for entering info and a button that, when pressed, changes the text property of a Label object. If you type your name in the text box and click the button, it prints "Hello <your name>" in a Label.

## The Code:

    ' Gambas class file

    STATIC PUBLIC SUB Main()
      DIM hForm AS Fmain
      hForm = NEW Fmain
      hForm.show
    END

    PUBLIC SUB Button1_Click()

'Use "&" to concatenate strings :

      TextLabel1.Text = "Hello " & TextBox1.Text
    END

## The Source

Download