source: 3thparty/jmessenger/src/com/swabunga/util/StringUtility.java @ 3952

Revision 3952, 614 bytes checked in by alexandrecorreia, 13 years ago (diff)

Ticket #1710 - Adicao do codigo fonte java do componente jmessenger(jabberit_messenger)

  • Property svn:executable set to *
Line 
1package com.swabunga.util;
2
3public class StringUtility {
4  public static StringBuffer replace(StringBuffer buf, int start, int end, String text) {
5    int len = text.length();
6    char[] ch = new char[buf.length() + len - (end - start)];
7    buf.getChars(0, start, ch, 0);
8    text.getChars(0, len, ch, start);
9    buf.getChars(end, buf.length(), ch, start + len);
10    buf.setLength(0);
11    buf.append(ch);
12    return buf;
13  }
14
15  public static void main(String[] args) {
16    System.out.println(StringUtility.replace(new StringBuffer(args[0]), Integer.parseInt(args[2]), Integer.parseInt(args[3]), args[1]));
17  }
18}
Note: See TracBrowser for help on using the repository browser.