public static String unquote(String s) { if (s.startsWith("\"") && s.endsWith("\"") && s.length() > 1) return s.substring(1, s.length()-1).replace("\\\"", "\"").replace("\\n", "\n").replace("\\r", "\r").replace("\\\\", "\\"); // SHOULD work... return s; }
Snippet is not live.
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
ID | Author/Program | Comment | Date | |
---|---|---|---|---|
983 | #1000604 (pitcher) | 2015-08-20 15:28:24 | ||
982 | #1000610 | Edit suggestion: !636 !629 main { static Object androidContext; static String programID; public static void main(String[] args) throws Exception { public static String unquote(String s) { if (s.startsWith("\"") && s.endsWith("\"") && s.length() > 1) return s.substring(1, s.length()-1).replace("\\\"", "\"").replace("\\n", "\n").replace("\\r", "\r").replace("\\\\", "\\"); // SHOULD work... return s; } }} | 2015-08-20 10:14:07 | delete |
Snippet ID: | #2000443 |
Snippet name: | function unquote |
Eternal ID of this version: | #2000443/1 |
Text MD5: | 0f64f447c142dd94d24908e054077541 |
Author: | stefan |
Category: | |
Type: | New Tinybrain snippet |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-07-06 18:20:37 |
Source code size: | 276 bytes / 5 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 904 / 186 |
Referenced in: | #2000471 - function unquote (extended for multi-line strings) #3000382 - Answer for ferdie (>> t = 1, f = 0) #3000383 - Answer for funkoverflow (>> t=1, f=0 okay) |