Hey everyone!
I want to insert (dynamic number of) multiple spaces inside a text field. How can this be achieved using \n?
I figured out that in order to insert three spaces i need to do the following
s="\n";
s=s+s+s;
which led me to the conclusion that in order to insert say x number of spaces, I need to sum the variable 's' x number of times i.e. I need to use the mathematical function summation. Unfortunately there's no ∑ (summation function) in the action script.
Kindly help in this regard.
Thus far, I've developed the following
n="\n";
diff=10;
i=0;
while(i<=diff)
{
i=i+1;
n= ;
};
What should I write after n=
Help regarding inserting multiple spaces
Moderator: Martin
Re: Help regarding inserting multiple spaces
Multiple spaces >> mutiple blank lines?
To "sum string", use concatenate, concat()
concat("hello", "\n") will give "hello\n"
I usually use for() loop
n now has 10 blank lines.
To "sum string", use concatenate, concat()
concat("hello", "\n") will give "hello\n"
I usually use for() loop
Code: Select all
diff = 10;
n = "";
for(i in [1 to diff])
n = concat(n,"\n")
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Help regarding inserting multiple spaces
I forgot to type the other way. For simple space or newline concatenation, you can just use inline expression.
concat() is mostly used when you have to use some dynamic value or want to eval value first before concat them.
Code: Select all
n = "{n}\n"
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.