1 | String substitute(Object input,String replace) {↵ | | 1 | String substituteAll(Object input,String replace) {↵
|
2 | return substitute(input,replace,0,0);↵ | | 2 | return substituteAll(input,replace,0,0);↵
|
3 | }↵ | | 3 | }↵
|
|
4 | /**↵ | | 4 | /**↵
|
5 | * Substitutes the replacement text for the first match found ↵ | | 5 | * Substitutes the replacement text for each non-overlapping match found ↵
|
6 | in the input↵ | | 6 | * in the input↵
|
7 | * beginning at the specified index position. Specifying an index↵ | | 7 | text, starting at the specified index↵
|
8 | * effectively causes↵ | | 8 | .↵
|
| | | 9 | *↵
|
9 | the regular expression engine to throw away the↵ | | 10 | * If the regular expression allows the empty string to ↵
|
10 | * specified number of characters. ↵ | | 11 | match, it will↵
|
| | | 12 | * substitute matches at all positions except the end of the input.↵
|
11 | *↵ | | 13 | *↵
|
12 | * @param input The input text.↵ | | 14 | * @param input The input text.↵
|
13 | * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).↵ | | 15 | * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).↵
|
14 | * @param index The offset index at which the search should be begin.↵ | | 16 | * @param index The offset index at which the search should be begin.↵
|
15 | * @return A String containing the substring of the input, starting↵ | | 17 | * @return A String containing the substring of the input, starting↵
|
16 | * at the index position, and interpolating the substituted text.↵ | | 18 | * at the index position, and interpolating the substituted text.↵
|
17 | * @see REMatch#substituteInto↵ | | 19 | * @see REMatch#substituteInto↵
|
18 | */↵ | | 20 | */↵
|
19 | public String substitute(Object input,String replace,int index) {↵ | | 21 | public String substituteAll(Object input,String replace,int index) {↵
|
20 | return substitute(input,replace,index,0);↵ | | 22 | return substituteAll(input,replace,index,0);↵
|
21 | }↵ | | 23 | }↵
|
| | | 24 | ↵
|
22 | /**↵ | | 25 | /**↵
|
23 | * Substitutes the replacement text for the first match found ↵ | | 26 | * Substitutes the replacement text for each non-overlapping match found ↵
|
24 | in the input↵ | | 27 | * in the input↵
|
25 | * string, beginning at the specified index position and using the↵ | | 28 | text, starting at the specified index and using the↵
|
26 | * specified execution flags.↵ | | 29 | * specified execution flags.↵
|
27 | *↵ | | 30 | *↵
|
28 | * @param input The input text.↵ | | 31 | * @param input The input text.↵
|
29 | * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).↵ | | 32 | * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).↵
|
30 | * @param index The offset index at which the search should be begin.↵ | | 33 | * @param index The offset index at which the search should be begin.↵
|
31 | * @param eflags The logical OR of any execution flags above.↵ | | 34 | * @param eflags The logical OR of any execution flags above.↵
|
32 | * @return A String containing the substring of the input, starting↵ | | 35 | * @return A String containing the substring of the input, starting↵
|
33 | * at the index position, and interpolating the substituted text.↵ | | 36 | * at the index position, and interpolating the substituted text.↵
|
34 | * @see REMatch#substituteInto↵ | | 37 | * @see REMatch#substituteInto↵
|
35 | */↵ | | 38 | */↵
|
36 | public String substitute(Object input,String replace,int index,int eflags) {↵ | | 39 | public String substituteAll(Object input,String replace,int index,int eflags) {↵
|
37 | return substituteImpl(makeCharIndexed(input,index),replace,index,eflags);↵ | | 40 | return substituteAllImpl(makeCharIndexed(input,index),replace,index,eflags);↵
|
38 | } | | 41 | }
|