List of utility methods to do List Replace
void | replacePolUtilsName(final List replace Pol Utils Name final String npcIdLine = npcListSqlLines.get(lineIndex); int startIndex = npcIdLine.indexOf(","); startIndex = npcIdLine.indexOf(",", startIndex + 1); int nextQuote = npcIdLine.indexOf("'", startIndex + 2); int endIndex = npcIdLine.indexOf(",", startIndex + 1); if (endIndex < nextQuote) { endIndex = npcIdLine.indexOf(",", endIndex + 1); final String newLine; if (name == null) { newLine = npcIdLine.substring(0, startIndex + 1) + "\'\'" + npcIdLine.substring(endIndex, npcIdLine.length()); } else { newLine = npcIdLine.substring(0, startIndex + 1) + '\'' + name.replaceAll("'", "\\\\'") + '\'' + npcIdLine.substring(endIndex, npcIdLine.length()); npcListSqlLines.set(lineIndex, newLine); |
void | replacePositions(StringBuffer c, int origLength, String string, List positions) replace Positions int offset = 0; for (Iterator iter = positions.iterator(); iter.hasNext();) { int position = ((Integer) iter.next()).intValue(); c.replace(offset + position, offset + position + origLength, string); offset += string.length() - origLength; |