mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Add function for quoting strings
(cherry picked from commit 7dcf5b011a
)
This commit is contained in:
parent
5a7e7fc35f
commit
edc34cc1a2
4 changed files with 22 additions and 31 deletions
|
@ -1205,28 +1205,6 @@ template StringSet tokenizeString(std::string_view s, const string & separators)
|
|||
template vector<string> tokenizeString(std::string_view s, const string & separators);
|
||||
|
||||
|
||||
string concatStringsSep(const string & sep, const Strings & ss)
|
||||
{
|
||||
string s;
|
||||
for (auto & i : ss) {
|
||||
if (s.size() != 0) s += sep;
|
||||
s += i;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
string concatStringsSep(const string & sep, const StringSet & ss)
|
||||
{
|
||||
string s;
|
||||
for (auto & i : ss) {
|
||||
if (s.size() != 0) s += sep;
|
||||
s += i;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
string chomp(const string & s)
|
||||
{
|
||||
size_t i = s.find_last_not_of(" \n\r\t");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue