Skip to content

Commit

Permalink
Update TaskList.java
Browse files Browse the repository at this point in the history
find method was updated to fix bug.
  • Loading branch information
gongg21 committed Sep 23, 2023
1 parent 200c3dd commit 4ec86bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/gbot/TaskList.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,11 @@ public String deleteAllTasks() {
* @param keyword The keyword given by user.
*/
public String find(String keyword) {
assert keyword != null;
ArrayList<Task> matchList = new ArrayList<>();
for (int i = 0; i < taskCount; i++) {
Task curr = list.get(i);
if (curr.getDescription().toLowerCase().contains(keyword)) {
if (curr.getDescription().toLowerCase().contains(keyword.strip())) {
matchList.add(curr);
}
}
Expand Down

0 comments on commit 4ec86bb

Please sign in to comment.