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

8
LINES

< > BotCompany Repo | #1023590 // makeAGIDomainPart - convert any string into an AGI domain part

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1988L/13K).

1  
sS makeAGIDomainPart(S s) {
2  
  // OLD version: LS tok = unquoteAll(wordTokC_noBrackets(trim(s)));
3  
  LS tok = cloneList(wordTok2(s));
4  
  for (int i = 2; i < l(tok)-2; i += 2)
5  
    tok.set(i, containsNewLine(tok.get(i)) ? "--" : "-");
6  
  setFirstAndLast(tok, "");
7  
  ret replaceAll(join(tok), "'", "");
8  
}

Author comment

Began life as a copy of #1023575

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023590
Snippet name: makeAGIDomainPart - convert any string into an AGI domain part
Eternal ID of this version: #1023590/7
Text MD5: e7046deae40b38b0b7de7ccc26546db8
Transpilation MD5: bbd70fed137948d79785da8b67255de9
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-07-04 21:40:13
Source code size: 304 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 372 / 469
Version history: 6 change(s)
Referenced in: [show references]