Timeline for How to declare a string as unescaped after storing in a variable?
Current License: CC BY-SA 4.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 1, 2023 at 2:00 | vote | accept | licheng | ||
| Oct 1, 2023 at 1:11 | comment | added | licheng | This kind of import is not something I can copy and paste, unless Mathematica can handle it itself. I think I need to reopen a pipe transmission issue. | |
| Oct 1, 2023 at 1:02 | comment | added | licheng | I'm temporarily holding off on accepting answers because I don't understand it yet. What I mean is that the string we get may not be copied manually, but passed from other places, such as shell. In this case, I may pay attention to the problem that needs to be escaped. So I have to first import the string into a variable and then declare it without escaping. Maybe these worries are unnecessary. | |
| Sep 30, 2023 at 16:25 | comment | added | Szabolcs | I was simply trying to point out that the issue is with the way you enter strings into Mathematica. The two methods I present here (use a file, or paste inbetween quotes and let Mathematica do the escaping) are both robust. What you are trying to do is not. The answer you accepted is simply wrong, beware of trying to do that. | |
| Sep 30, 2023 at 15:59 | comment | added | licheng | If the number of strings is small or reading files, your method is nice. But I'm a bit worried about this pipeline transmission. | |
| Sep 30, 2023 at 15:56 | comment | added | licheng | Sometimes strings come from other programs, such as geng, transmission pipelines rather than files, such as your code in the link mathematica.stackexchange.com/a/211292/67902. I am a bit worried that ImportString in your codes may cause the same problem. | |
| Sep 30, 2023 at 11:24 | history | answered | Szabolcs | CC BY-SA 4.0 |