Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Concetenatnation questions

Avatar

Level 8

Hello

When concatenating a couple of strings, i need to get them in 2 lines/rows on the form, like below,

my_ID + " " + my_date + " " + my_time + my_COMMENT

i need it to display like below

ABC 08-26-2011 09:08

This is my COMMENT that My COMMENT should come in next line, pls. let me know how to concatenate the above strings, pls. let me know Java Script

     Actually, i kept it like below, but not working corerctly,

my_ID + " " + my_date + " " + my_time + "                                                                                                           " +my_COMMENT

Thank you

1 Accepted Solution

Avatar

Correct answer by
Level 10

the \n is a newline in javascript so your code shoudl be like this:

app.alert("This is line 1" + "\n This is line 2")

Paul

View solution in original post

0 Replies

Avatar

Correct answer by
Level 10

the \n is a newline in javascript so your code shoudl be like this:

app.alert("This is line 1" + "\n This is line 2")

Paul

Avatar

Level 8

Sorry, i forgot to mention that, am using variables, as below,

myFullString = my1stVariable.concat(my1stVariable + "                                                                                     " + my2ndVariable )

in this case, pls. let me know How to get my2ndVariable in next line, i mean, how to use/isert \n ?

THank you    

Avatar

Level 10

myfullString = my1stVar + "\n" + my2ndvar

Paul