Message Boards Message Boards

0
|
15311 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Remove the brackets around a list?

Posted 6 years ago

Is there a function in mathematica to remove the brackets around a list: Say {1,2,3} becomes 1,2,3. I tried Flatten it didn't work Thank You JME

POSTED BY: Javad Emami
2 Replies

Javad,

what a Mathematica expression returns is always another - single! - Mathematica expression. Just three numbers 1 2 3 represent three(!) expressions. If you want to have the {} removed just in the context of visibility or presentation then the above solution of Mariusz is perfect. You have to be aware that it is still a single expression:

Row[{1, 2, 3}, ","] // FullForm
(* Out:   Row[List[1,2,3],","] *)

If your question is meant in a more syntactical context you probably need Sequence:

s = Sequence @@ {1, 2, 3};
{a, s, b}
(* Out: {a,1,2,3,b} *)

Regards -- Henrik

POSTED BY: Henrik Schachner

Hi.

Try:

Row[{1, 2, 3}, ","]

Regards Mariusz

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract