Line | |
---|
1 | package ise.antelope.tasks.typedefs.string;
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Copyright 2003
|
---|
5 | *
|
---|
6 | * @version $Revision: 1.1 $
|
---|
7 | */
|
---|
8 | public class Replace implements StringOp {
|
---|
9 |
|
---|
10 |
|
---|
11 | private String regex = "";
|
---|
12 | private String replacement = "";
|
---|
13 |
|
---|
14 | public void setRegex(String regex) {
|
---|
15 | this.regex = regex;
|
---|
16 | }
|
---|
17 |
|
---|
18 | public void setReplacement(String replacement) {
|
---|
19 | this.replacement = replacement;
|
---|
20 | }
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Description of the Method
|
---|
24 | *
|
---|
25 | * @param s
|
---|
26 | * @return Description of the Returned Value
|
---|
27 | */
|
---|
28 | public String execute(String s) {
|
---|
29 | return s.replaceAll(regex, replacement);
|
---|
30 |
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.