views:

78

answers:

8

What is the best format to communicate an array of strings in one string to users who are not geeks?

I could do it like this:

Item1, Item2, Item3

But that becomes meaningless when the strings contain spaces and commas.

I could also do it this way:

"Item1", "Item2", "Item3"

However, I would like to avoid escaping the array elements because escaped characters can be confusing to the uninitiated.

Edit: I should have clarified that I need the formatted string to be one-line. Basically, I have a list of lists displayed in a .Net Winforms ListView (although this question is language-agnostic). I need to show the users a one-line "snapshot" of the list next to the list's name in the ListView, so they get a general idea of what the list contains.

+1  A: 

In a GUI or color TUI, shade each element individually. In a monochrome TUI, add a couple of spaces and advance to the next tab position (\t) between each word.

Ignacio Vazquez-Abrams
+1  A: 

You can pick a character like pipe (|) which are not used much outside programs. It also used in wiki markup for tables which may be intuitive to those who are familiar with wiki markup.

Item1| Item2| Item3
Chandra Patni
This seems like the best way in my case, based on the latter part of avpx's answer.
Zach Johnson
+1  A: 

Using JSON, the above list would look like: '["Item1", "Item2", "Item3"]'. This is unambiguous and a syntax in widespread use. Just explain the nested syntax a little bit and they'll probably get it.

Of course, if this is to be displayed in a UI, then you don't necessarily want unambiguous syntax as much as you want it to actually look like something intended for the end user. In that case it would depend exactly how you are displaying this to the user.

avpx
Not geek eh? :>
Kornel Kisielewicz
@avpx: the second paragraph is very helpful. Thanks!
Zach Johnson
+1  A: 

Display each element as a cell in a table.

chroma
+1  A: 

How about line breaks after each string? :>

Kornel Kisielewicz
+1  A: 

Display each string on a separate line, with line numbers:

1. Make a list
2. Check it twice
3. Say something nice

It's the way people write lists in the real world, y'know :)

elo80ka
+1  A: 

Use some kind of typographical convention, for example a bold hashmark and space between strings.

milk # eggs # bread # apples # lettuce # carrots

Ollie Jones
A: 

CSV. Because the very first thing your non-technical user is going to do with delimited data is import it into a spreadsheet.

Wayne Conrad