1 | public static String unquote(String s) { |
2 | if (s.startsWith("[[") && s.endsWith("]]")) |
3 | return s.substring(2, s.length()-2); |
4 | else if (s.startsWith("\"") && s.endsWith("\"") && s.length() > 1) |
5 | return s.substring(1, s.length()-1).replace("\\\"", "\"").replace("\\\\", "\\"); // SHOULD work... |
6 | else |
7 | return s; // return original |
8 | } |
Began life as a copy of #2000443
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: | #2000471 |
Snippet name: | function unquote (extended for multi-line strings) |
Eternal ID of this version: | #2000471/1 |
Text MD5: | 77a87e406e829edba2c22a4e183c87e6 |
Author: | stefan |
Category: | |
Type: | New Tinybrain snippet |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-07-30 19:45:45 |
Source code size: | 364 bytes / 8 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 620 / 433 |
Referenced in: | [show references] |