Libkleo

stringutils.cpp
1/*
2 utils/stringutils.cpp
3
4 This file is part of libkleopatra
5 SPDX-FileCopyrightText: 2021 g10 Code GmbH
6 SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11#include <config-libkleo.h>
12
13#include "stringutils.h"
14
15std::vector<std::string> Kleo::split(const std::string &s, char c)
16{
17 std::vector<std::string> result;
18
19 auto start = 0;
20 auto end = s.find(c, start);
21 while (end != s.npos) {
22 result.push_back(s.substr(start, end - start));
23 start = end + 1;
24 end = s.find(c, start);
25 }
26 result.push_back(s.substr(start));
27
28 return result;
29}
Q_SCRIPTABLE Q_NOREPLY void start()
const QList< QKeySequence > & end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.