BBjString::replaceFirst
Description
In BBj 7.0 and higher, this method replaces the first substring of this string that matches the given regular expression with the given replacement.
An invocation of this method of the form str.replaceFirst(regex, repl) yields exactly the same result as the expression:
compile(regex).matcher(str).replaceFirst(repl)
Note that backslashes (\) and dollar signs ($) in the replacement string may cause the results to be different than if it were being treated as a literal replacement string; see Matcher.replaceFirst. Use Matcher.quoteReplacement to suppress the special meaning of these characters, if desired.
Syntax
Return Value |
Method |
---|---|
String |
replaceFirst(string regex, string replacement) |
Parameters
Variable |
Description |
regex |
The regular expression to which this string is to be matched. |
replacement |
The string to be substituted for the first match. |
Return Value
Returns the resulting String.
Remarks
None.
Example
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.