Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

5
LINES

< > BotCompany Repo | #2000443 // function unquote

New Tinybrain snippet

 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;
  }

download  show line numbers   

Snippet is not live.

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

Comments [hide]

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 

add comment

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: 901 / 185
Referenced in: [show references]