3
$\begingroup$

When trying the below code, is there a more elegant way to output the numbers without the commas or brackets? Grid, as suggested in other threads, is not behaving as expected, nor did trying to force a blank space with Row[list," "] between each item work. The intent is to copy and paste the cleaned output for other uses.

encode:=FormPage[{"message"->"String", "key"->"Integer"},
 Row[Times[ToCharacterCode[#message],#key]
  ,Spacer[4]]&]
CloudDeploy@encode
$\endgroup$
1
  • $\begingroup$ Suggest you look at TableForm. $\endgroup$
    – m_goldberg
    Sep 23 '17 at 16:32
2
$\begingroup$

One approach is to turn everything into a string

list = Range[5];
StringJoin[ToString /@ Riffle[list, " "]]

1 2 3 4 5

You can copy-paste this output directly.

$\endgroup$
2
$\begingroup$

I use when I do not want nothing between elements of list Grid[list, Frame->None]

$\endgroup$
4
  • 1
    $\begingroup$ Hmmm.. This is the output in the cloud once updated: Grid[{38628, 34632, 34965, 38295, 10656, 34965, 38295, 10656, 38628, 34632, 33633, 10656, 33633, 36630, 33300}, Frame -> None] $\endgroup$
    – BBirdsell
    Sep 23 '17 at 22:28
  • $\begingroup$ One update to Axon Pués' answer. I can't comment because I don't have enough reputation. Grid requires at least 2 dimensions. So youll have to do Grid[{list}, Frame->None] $\endgroup$
    – Pavan Shah
    Jul 21 at 15:58
  • $\begingroup$ Row[list] is a quick way to do this. $\endgroup$
    – Daniel W
    Jul 21 at 17:56
  • 1
    $\begingroup$ Grid requires a 2D array, that's why it's not working. You'd need Grid[List @ {38628, 34632, 34965, 38295, 10656, 34965, 38295, 10656, 38628, 34632, 33633, 10656, 33633, 36630, 33300}, Frame -> None] for that to work. $\endgroup$ Jul 21 at 20:33
1
$\begingroup$
list = Range[5];

StringRiffle[list, " "]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.