Skip to content

Commit

Permalink
Allow join delimitor to be specified
Browse files Browse the repository at this point in the history
  • Loading branch information
appml committed Nov 15, 2023
1 parent 32c6ca8 commit 60b5ebd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/main/java/com/appmindlab/nano/DisplayDBEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -2330,8 +2330,12 @@ else if (expanded.startsWith(Const.REPLACE_SYM)) { // Replace command
// 2. New pattern
params = expanded.split(Const.SHORTCUTS_PATTERN_DELIMITER);
params = Utils.cleanStringArray(params);
if (params.length == 2)
if (params.length == 2) {
if (params[1].contains(Const.SPACE_ENTITY))
params[1] = params[1].replaceAll(Const.SPACE_ENTITY, Const.EMPTY_SYM);

expanded = extra.replaceAll(params[0], params[1]).trim();
}
else
expanded = null;
}
Expand Down Expand Up @@ -2379,8 +2383,8 @@ else if (expanded.startsWith(Const.JOIN_SYM)) { // Join command
params = Utils.cleanStringArray(params);

if (params.length == 1) {
if (params[0].equals(Const.SPACE_ENTITY))
params[0] = Const.EMPTY_SYM;
if (params[0].contains(Const.SPACE_ENTITY))
params[0] = params[0].replaceAll(Const.SPACE_ENTITY, Const.EMPTY_SYM);

expanded = extra.replaceAll(Const.NEWLINE, params[0]).trim();
}
Expand Down

0 comments on commit 60b5ebd

Please sign in to comment.