Revision 3030,
614 bytes
checked in by amuller, 14 years ago
(diff) |
Ticket #1135 - Aplicando alteracoes para o modulo jabberit_messenger.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[3030] | 1 | package com.swabunga.util; |
---|
| 2 | |
---|
| 3 | public 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.