Libraryless. Click here for Pure Java version (1741L/11K/27K).
// Syntax: s == "bla" !636 !JavaTok !sf public class main { public static void main(String[] args) throws Exception { String s = loadMainJava(); List<String> tok = JavaTok.split(s); for (int i = 1; i+6 < tok.size(); i += 2) if (Character.isLetter(tok.get(i).charAt(0)) && "!=".indexOf(tok.get(i+2)) >= 0 && tok.get(i+4).equals("=") && tok.get(i+6).startsWith("\"")) { String var = tok.get(i), str = tok.get(i+6); boolean neg = tok.get(i+2).equals("!"); for (int j = i; j <= i+6; j++) tok.set(j, ""); tok.set(i, (neg ? "!" : "") + str + ".equals(" + var + ")"); i += 6; } saveMainJava(JavaTok.join(tok)); } }
Began life as a copy of #1000635 Now handles != too
download show line numbers debug dex old transpilations
Travelled to 21 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, dhtvkmknsjym, gwrvuhgaqvyk, hxnwyiuffukg, ishqpsrjomds, jlatgrcjtklg, jtubtzbbkimh, liwcxgsjrgqn, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1000636 |
Snippet name: | Compare strings with "==" instead of "equals" (JavaX translator) |
Eternal ID of this version: | #1000636/1 |
Text MD5: | ac8dbb1a94f9ad4e86830a7dc5e8f965 |
Transpilation MD5: | 090df86ec6cbfa5d3747d39abf3f2e32 |
Author: | stefan |
Category: | |
Type: | JavaX translator |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-09-04 21:50:17 |
Source code size: | 742 bytes / 28 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 722 / 15449 |
Referenced in: | [show references] |