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

12
LINES

< > BotCompany Repo | #1011499 // ai_dropDroppablePrefix - only does one step

JavaX fragment (include)

1  
static S ai_dropDroppablePrefix(S s) {
2  
  for (WebNode node : ai_search_dollarX_verified("$X", "is", "a droppable prefix")) {
3  
    if (isQuoted(web_text(node))) {
4  
      S tail = web_unquote(node);
5  
      if (nempty(tail) && swic(s, tail)) {
6  
        print("Dropping prefix: " + quote(tail));
7  
        ret trim(substring(s, l(tail)));
8  
      }
9  
    }
10  
  }
11  
  ret s;
12  
}

Author comment

Began life as a copy of #1011497

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1011499
Snippet name: ai_dropDroppablePrefix - only does one step
Eternal ID of this version: #1011499/2
Text MD5: 1ae778081e46f4a0dbbcbff55da4325c
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-01-12 10:07:44
Source code size: 368 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 436 / 465
Version history: 1 change(s)
Referenced in: [show references]