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

8
LINES

< > BotCompany Repo | #2000564 // function quote

New Tinybrain snippet

1  
  static String quote(String s) {
2  
    if (s == null) return "null";
3  
    return "\"" + s.replace("\\", "\\\\").replace("\"", "\\\"").replace("\r", "\\r").replace("\n", "\\n") + "\"";
4  
  }
5  
  
6  
  static String quote(long l) {
7  
    return quote("" + l);
8  
  }

Author comment

Began life as a copy of #2000442

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

No comments. add comment

Snippet ID: #2000564
Snippet name: function quote
Eternal ID of this version: #2000564/1
Text MD5: 938f7cf3beb7de4fff8d02c0330e717a
Author: stefan
Category:
Type: New Tinybrain snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-10-04 15:03:49
Source code size: 259 bytes / 8 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 475 / 109
Referenced in: [show references]