Hello Ventuzians!
THE FORUMS ARE CLOSED!

Please join our discord server HERE!! << click me :D

We are shutting our Ventuz Forum, but don't worry, it will all be archived for you to search in if you have a query. From now on, please add all your comments, questions or observations into our Discord Server

Thanks for the great time - see you on discord!!
Dee, Karol, Daniel and the whoooole Product and Support team!

Array output to vertical list

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
joysprod
Posts: 201
Joined: 20 Jan 2012, 12:24
Location: United Kingdom

Array output to vertical list

Post by joysprod » 30 Aug 2016, 13:00

Hi, Appreciate any help on this. I have an array of names and I want to show them as a vertical list. i.e.

Name 1, Name 2, Name 3, Name 4, Name x as the output from my array, but I would like to easily show as a single text...

Name 1
Name 2
Name 3
Name 4
Name x

I have tried to use a String Replace node on the occurrence of every comma but cant find how to put in a carriage return instead ( If that would in fact work)

Regards

Peter

User avatar
lerou
Posts: 345
Joined: 06 Sep 2013, 07:14
Location: Hamburg, Germany

Re: Array output to vertical list

Post by lerou » 30 Aug 2016, 14:54

try putting your string array into a string expression. Use the following as the expression:
A.Replace(", ", "\n")

A string array is converted to a string as "One, Two, Three". Note the spaces. Now we replace the comma-space ", " by a line break. Not the cleanes solition but it should work.

cheers,
rou
Attachments
array.jpg

joysprod
Posts: 201
Joined: 20 Jan 2012, 12:24
Location: United Kingdom

Re: Array output to vertical list

Post by joysprod » 30 Aug 2016, 16:34

Brilliant!

Thanks Rou.

stephen
Posts: 74
Joined: 06 Aug 2013, 14:11

Re: Array output to vertical list

Post by stephen » 30 Aug 2016, 16:48

Hey Peter, Rou,

just a side note:
You do not necessarily need to use an Expression Node. You can also still use the String Replace Node. Just type the New Line in the Text Editor instead of the Property Editor by clicking on the three dots in the Replace Property. Here you can insert line breaks by simply hitting the Return Key on your keyboard. So it is not really a problem of the Replace Node, but the Property Editor.

The Property Editor is only able to edit one-line strings - therefore you cannot insert a new line in here. The Text Editor can, though. :D
TextEditorNewLine.png
Stephen

Post Reply