Generically how could I perform a search and replace on a link or text piece that came from a database. Here is an example. I need to tag links with special identifiers on some JSP pages. The links are sent via the database to a template, so you cannot parse the tags the normal way or use functions since the page is already been parsed. Someone said to use a search and replace. What is the best way to do that.
put what needs searhing into a javaranch string: com.javaranch.common.Str str = new Str(yourString); then call replace(String s1, String s2) on it. be careful though, you might want to take a look at the new regex package (new to JDK1.4) to use strict replacement patterns
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop