static String quote(O o) { if (o == null) return "null"; S s = str(o); return "\"" + s.replace("\\", "\\\\").replace("\"", "\\\"").replace("\r", "\\r").replace("\n", "\\n") + "\""; }
Began life as a copy of #2000564
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1001239 |
Snippet name: | function quote |
Eternal ID of this version: | #1001239/1 |
Text MD5: | bf9dd33fe7e3d576af8a6674f2257945 |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-10-30 17:41:02 |
Source code size: | 192 bytes / 5 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 652 / 8827 |
Referenced in: | #1002427 - Accellerating 629 (SPIKE) #1003279 - function quoteCharacter #1005595 - quote - Java-compatible string quoting with "". now also escapes \t #3000382 - Answer for ferdie (>> t = 1, f = 0) |