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  old transpilations   

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

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: 628 / 2673
Version history: 1 change(s)
Referenced in: #1000832 - bashQuote function
#1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1009625 - winQuote2 function - experimental
#3000382 - Answer for ferdie (>> t = 1, f = 0)