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

5
LINES

< > BotCompany Repo | #2000347 // addFunction

New Tinybrain snippet

  public static String addFunction(String s, String fID) throws IOException {
    int i = s.lastIndexOf('}');
    String function = loadSnippet(fID);
    return s.substring(0, i) + "\n" + function +"\n" + s.substring(i);
  }

download  show line numbers   

Snippet is not live.

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

Comments [hide]

ID Author/Program Comment Date
291 #1000604 (pitcher) 2015-08-18 00:54:32
248 #1000610 (pitcher) Edit suggestion:
!636
!629

main {
static Object androidContext;
static String programID;

public static void main(String[] args) throws Exception {
public static String addFunction(String s, String fID) throws IOException {
int i = s.lastIndexOf('}');
String function = loadSnippet(fID);
return s.substring(0, i) + "\n" + function +"\n" + s.substring(i);
}
}}
2015-08-18 00:52:51
60 stefan Can also add multiple functions and any other declaration type. Does not check if stuff exists in class already. 2015-05-11 17:55:46

add comment

Snippet ID: #2000347
Snippet name: addFunction
Eternal ID of this version: #2000347/1
Text MD5: a4efcbfd905165b8a0e4b50de521f2fc
Author: stefan
Category: javax
Type: New Tinybrain snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-05-11 17:55:20
Source code size: 228 bytes / 5 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 914 / 131
Referenced in: [show references]