![]() |
|
|
Concatenating Strings in ASP/VBScriptIn ASP you concatenate strings with the use of the ampersand (&) placed between the strings that you wish to join. For example think of a scenario where you had the firstname and lastname of a customer stored in separate variables and you wished to join and display them as one string. The example below creates two variables sFirstName and sLastName and assigns them values. We then write them to the browser combining all the strings using ampersands. Notice the space character between the variables sFirstName and sLastName, this is just used for formatting purposes. Example 1:
<%
'Declare variables Dim sFirstName, sLastName sFirstName ="John" sLastName="Doe" Response.write "Customer name is " & sFirstName & " " & sLastName %> The result:
Site developed by Michael Wall - Web Design Belfast N.Ireland. |
|