Skip to content

Commit cdc637e

Browse files
Fix reviewed comments
1 parent 5f21d9e commit cdc637e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ballerina/natives.bal

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ public isolated function replace(string originalString, string regex, Replacemen
4545
int startIndex = 0) returns string {
4646
string extractedString = getSubstring(originalString, startIndex);
4747
string|error replacementString = getReplacementString(originalString, regex, replacement, startIndex);
48-
if (replacementString is error) {
48+
if replacementString is error {
4949
return originalString;
5050
}
51-
handle|error value = trap replaceFirstExternal(java:fromString(subString), java:fromString(regex),
51+
handle|error value = trap replaceFirstExternal(java:fromString(extractedString), java:fromString(regex),
5252
java:fromString(replacementString));
53-
if (value is handle) {
53+
if value is handle {
5454
string? updatedString = java:toString(value);
5555
if updatedString is string {
5656
return strings:substring(originalString, 0, startIndex) + updatedString;
@@ -152,8 +152,8 @@ public isolated function split(string receiver, string delimiter) returns string
152152
# + startIndex - The starting index for the search
153153
# + return - a `Match` record which holds the matched substring, or nil if there is no match
154154
public isolated function search(string str, string regex, int startIndex = 0) returns Match? {
155-
string subString = getSubstring(str, startIndex);
156-
handle matcher = getMatcher(subString, regex);
155+
string extractedString = getSubstring(str, startIndex);
156+
handle matcher = getMatcher(extractedString, regex);
157157
if isMatched(matcher) {
158158
handle group = getGroup(matcher, 0);
159159
string? value = java:toString(group);

0 commit comments

Comments
 (0)