Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.2K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How to convert a variable to a string with quote marks around it

Posted 4 years ago

I have a list of symbols, but I want to put each symbol within quote marks ("AA", "AAL", "AAPL", "ABNB" ). I have tried ToString[] but I don't get the quote marks, I have tried Table[] but when I put quotes marks around the list name it degenerates into a string and nothing desirable happens. Can it be done???

lisVol = {AA, AAL, AAPL, ABNB}
POSTED BY: Raymond Low
4 Replies
Posted 4 years ago

The problem is here

list2 = Map[ToString, list1] // InputForm

Form wrappers (InputForm, TableForm, MatrixForm, ...) are in general not computable

(list2 = Map[ToString, list1]) // InputForm
FinancialData[list2]
POSTED BY: Rohit Namjoshi

To my extreme annoyment, in StandardForm the quote marks are invisible, but they are there:

lisVol = {AA, AAL, AAPL, ABNB};
Map[ToString, lisVol] // InputForm

To my further annoyment, when copying and pasting strings, sometimes the invisible quotes are copied, sometimes not.

POSTED BY: Gianluca Gorni
Posted 4 years ago
POSTED BY: Raymond Low
Posted 4 years ago

Hi Gianluca,

Yes, it is annoying, I have learned to live with it. There is an option ShowStringCharacters that can be changed from the options inspector but it changes the behavior for Input cells, not Output cells.

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