Skip to content

Commit

Permalink
Merge pull request #488 from devosoft/FergusonAJ-patch-1
Browse files Browse the repository at this point in the history
Fix Keep/RemoveIfBegins
  • Loading branch information
mercere99 authored Sep 11, 2023
2 parents 6c0eff2 + 3167d06 commit 79609e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/emp/io/File.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,14 @@ namespace emp {
/// Keep only strings that contain a specific substring.
File & KeepIfBegins(const String & prefix) {
return KeepIf(
[&prefix](const String & line){ return line.find(prefix) != String::npos; }
[&prefix](const String & line){ return line.find(prefix) == 0; }
);
}

/// Remove all strings that contain a specific substring.
File & RemoveIfBegins(const String & prefix) {
return KeepIf(
[&prefix](const String & line){ return line.Find(prefix) == String::npos; }
[&prefix](const String & line){ return line.Find(prefix) != 0; }
);
}

Expand Down

0 comments on commit 79609e2

Please sign in to comment.