Skip to content

Commit f277663

Browse files
committed
Fix find and replace
1 parent aef9595 commit f277663

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/src/main/java/com/adgad/kboard/KCommands.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ public void run() {
498498
commands = new String[1];
499499
commands[0] = cmd;
500500
int numberOfTimes = cmd.indexOf("e") > 0 ? Integer.parseInt(cmd.substring(0, cmd.indexOf("e"))) : 1;
501-
String parameter = cmd.substring(cmd.indexOf("(") + 1, cmd.lastIndexOf(")"));
501+
String parameter = replaceDollarWords(cmd.substring(cmd.indexOf("(") + 1, cmd.lastIndexOf(")")));
502502
e(numberOfTimes, parameter);
503503
} else {
504504
commands = cmd.split(",");
@@ -539,20 +539,20 @@ public void run() {
539539
private String replaceDollarWords(String initial) {
540540
String newWord = initial;
541541
if(buffer != null) {
542-
newWord = newWord.replaceAll("\\$0", buffer);
542+
newWord = newWord.replace("$0", buffer);
543543
}
544544
if(KboardAccessibilityService.getCurrentWhatsappName() != null) {
545545
String fullName = KboardAccessibilityService.getCurrentWhatsappName();
546546
String[] names = fullName.split(" ");
547547

548548
if(names.length > 1) {
549-
newWord = newWord.replaceAll("\\$fname", names[0]);
550-
newWord = newWord.replaceAll("\\$lname", names[1]);
549+
newWord = newWord.replace("$fname", names[0]);
550+
newWord = newWord.replace("$lname", names[1]);
551551
} else {
552-
newWord = newWord.replaceAll("\\$fname", fullName);
552+
newWord = newWord.replace("$fname", fullName);
553553
}
554554

555-
newWord = newWord.replaceAll("\\$name", KboardAccessibilityService.getCurrentWhatsappName());
555+
newWord = newWord.replace("$name", KboardAccessibilityService.getCurrentWhatsappName());
556556
}
557557
return newWord;
558558
}

0 commit comments

Comments
 (0)