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()
QAction * end(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.