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

13
LINES

< > BotCompany Repo | #1000830 - winQuote function

JavaX fragment (include)

/** possibly improvable */
public static String winQuote(String text) {
  if (text == null) return null;
  return "\"" + text
    .replace("\\", "\\\\")
    .replace("\"", "\\\"")
    .replace("\n", "\\n")
    .replace("\r", "\\r") + "\"";
}

static S winQuote(File f) {
  ret winQuote(f.getAbsolutePath());
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1000830
Snippet name: winQuote function
Eternal ID of this version: #1000830/2
Text MD5: 759c7cfd5c1512138190a2af3ec990cb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-30 22:51:27
Source code size: 321 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 457 / 2410
Version history: 1 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1000830 & http://1000830.tinybrain.de