bgneal@4: // Copyright (C) 2012 by Brian Neal. bgneal@4: // This file is part of Cpp-Enigma, the Enigma Machine simulation. bgneal@4: // Cpp-Enigma is released under the MIT License (see License.txt). bgneal@4: // bgneal@4: // enigma_utils.cpp - Implementation file for enigma_utils.h. bgneal@4: bgneal@4: #include "enigma_utils.h" bgneal@4: bgneal@4: std::string enigma::remove_spaces(const std::string& s) bgneal@4: { bgneal@4: std::string result; bgneal@4: result.reserve(s.size()); bgneal@4: bgneal@4: for (const auto& c : s) bgneal@4: { bgneal@4: if (c != ' ') bgneal@4: { bgneal@4: result += c; bgneal@4: } bgneal@4: } bgneal@4: return result; bgneal@4: }