1 | public static String quote(String s) { |
2 | if (s == null) return "null"; |
3 | return "\"" + s.replace("\\", "\\\\").replace("\"", "\\\"").replace("\r", "\\r").replace("\n", "\\n") + "\""; |
4 | } |
Snippet is not live.
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #2000442 |
Snippet name: | function quote |
Eternal ID of this version: | #2000442/1 |
Text MD5: | db08ee623ad440e1d49b42af8dca603c |
Author: | stefan |
Category: | |
Type: | New Tinybrain snippet |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-07-06 18:19:53 |
Source code size: | 195 bytes / 4 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 548 / 2768 |
Referenced in: | [show references] |