SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Aug 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question concatenate two variables (was "PLZ help me")

    Hello,

    i am building a site and i need to know how i can put a variable in to a string and afther i did it it must be 1 new variable.
    example:
    VAR1 = 'hello'
    VAR2 = 1
    i want to get
    VAR3 = 'hello1'

    GTZ
    10us

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    var sFirstString = "It's raining";
    var sSecondString = " today...";
    var sTotal = sFirstString + sSecondString;
    
    alert(sTotal); // this will alert "It's raining today..."
    For a more detailed explanation on String concatenation, check out this page


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •