A Daire
A Daire

Reputation: 1

How to add a break line to a String AS2

I have this String in AS2 and instead of horizontal I need it vertical, however I'm not sure how to add the line break correctly.

var countdown:String = days + " . " + hours + " . " + minutes + " . " + seconds;

I'll appreciate your help!

Thanks!

Upvotes: 0

Views: 1142

Answers (2)

mentioned offitype
mentioned offitype

Reputation: 11

Use "newline" without quotations to create a line break in strings.

Example: var countdown:String = days + newline + hours + newline + minutes + newline + seconds;

\n does NOT work. I've tried just about every answer and newline was the only one that worked for me. It might be because I'm using Actionscript2 though.

Upvotes: 0

Andreas
Andreas

Reputation: 407

Simply append a newline character to the end of your string like so.

var countdown:String = days + " . " + hours + " . " + minutes + " . " + seconds + "\n";

Upvotes: 0

Related Questions