listformat issue

Post your questions and help other users.

Moderator: Martin

Post Reply
anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

listformat issue

Post by anuraag » 23 Jul 2018 15:40

I am using a script

Code: Select all

a = "abcd "; // space after abcd
b = "efgh "; // again space
c = "ijkl "; // again
e = newList(a, b, c);
f = "{e, listformat}"
Result contains extra quote marks

Code: Select all

"abcd "
"efgh "
"ijkl "
expected result

Code: Select all

abcd
efgh
ijkl
Is this by design of automagic?

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: listformat issue

Post by Desmanto » 23 Jul 2018 18:09

Probably a known issue with listformat, I encounter this several times. When you have space at the end of the string or newline char inside the list, it will be quoted. I am creating a flow to sort and auto double quote multiple lines. I don't use listformat, but use join() instead. This gives the same effect as listformat, except you can specify what is the joiner (in this case is newline char).

Code: Select all

f = join(e, "\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.

anuraag
Posts: 371
Joined: 24 Jan 2015 02:06

Re: listformat issue

Post by anuraag » 23 Jul 2018 23:53

Thanks Desmanto

Post Reply