Skip to content

Commit

Permalink
Fix Keep/RemoveIfBegins
Browse files Browse the repository at this point in the history
  • Loading branch information
FergusonAJ authored Sep 11, 2023
1 parent 6c0eff2 commit 3167d06
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 3167d06

Please sign in to comment.