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

13
LINES

< > BotCompany Repo | #1000830 // winQuote function

JavaX fragment (include)

1  
/** possibly improvable */
2  
public static String winQuote(String text) {
3  
  if (text == null) return null;
4  
  return "\"" + text
5  
    .replace("\\", "\\\\")
6  
    .replace("\"", "\\\"")
7  
    .replace("\n", "\\n")
8  
    .replace("\r", "\\r") + "\"";
9  
}
10  
11  
static S winQuote(File f) {
12  
  ret winQuote(f.getAbsolutePath());
13  
}

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: 689 / 2742
Version history: 1 change(s)
Referenced in: [show references]