From 3167d06a63e31171802b5579129726dee2ef52a3 Mon Sep 17 00:00:00 2001 From: Austin Ferguson Date: Mon, 11 Sep 2023 10:06:33 -0400 Subject: [PATCH] Fix Keep/RemoveIfBegins --- include/emp/io/File.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/emp/io/File.hpp b/include/emp/io/File.hpp index 4fecf239bc..b316032743 100644 --- a/include/emp/io/File.hpp +++ b/include/emp/io/File.hpp @@ -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; } ); }