Blue Brain BioExplorer
StringUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, EPFL/Blue Brain Project
3  *
4  * This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 3.0 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <string>
23 #include <vector>
24 
25 namespace core
26 {
27 namespace string_utils
28 {
29 std::string shortenString(const std::string& string, const size_t maxLength = 32);
30 
31 std::string replaceFirstOccurrence(std::string input, const std::string& toReplace, const std::string& replaceWith);
32 
33 std::string camelCaseToSeparated(const std::string& camelCase, const char separator);
34 
35 std::string separatedToCamelCase(const std::string& separated, const char separator);
36 
37 std::string join(const std::vector<std::string>& strings, const std::string& joinWith);
38 
39 std::string toLowercase(const std::string input);
40 
41 void trim(std::string& s);
42 
43 std::vector<std::string> split(const std::string& s, char delim);
44 } // namespace string_utils
45 } // namespace core
std::string join(const std::vector< std::string > &strings, const std::string &joinWith)
Definition: StringUtils.cpp:93
std::string separatedToCamelCase(const std::string &separated, const char separator)
Definition: StringUtils.cpp:74
void trim(std::string &s)
std::string shortenString(const std::string &string, const size_t maxLength)
Definition: StringUtils.cpp:37
std::string replaceFirstOccurrence(std::string input, const std::string &toReplace, const std::string &replaceWith)
Definition: StringUtils.cpp:49
std::string camelCaseToSeparated(const std::string &camelCase, const char separator)
Definition: StringUtils.cpp:57
std::vector< std::string > split(const std::string &s, char delim)
std::string toLowercase(std::string input)
std::vector< std::string > strings
Definition: Types.h:44