CbmRoot
Loading...
Searching...
No Matches
StlUtils.cxx
Go to the documentation of this file.
1
/* Copyright (C) 2024 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
2
SPDX-License-Identifier: GPL-3.0-only
3
Authors: Felix Weiglhofer [committer] */
4
5
#include "
StlUtils.h
"
6
7
using namespace
cbm
;
8
9
std::string
cbm::Capitalize
(std::string_view str)
10
{
11
if
(str.empty()) {
12
return
std::string(str);
13
}
14
15
std::string result(str);
16
result[0] = std::toupper(result[0]);
17
for
(
size_t
i = 1; i < result.size(); ++i)
18
result[i] = std::tolower(result[i]);
19
20
return
result;
21
}
StlUtils.h
This file contains utility functions for STL containers.
cbm
Definition
AlgoTraits.h:16
cbm::Capitalize
std::string Capitalize(std::string_view str)
Capitalize the first letter of a string. The rest of the string is made lowercase.
Definition
StlUtils.cxx:9
algo
base
util
StlUtils.cxx
Generated on Sun Dec 22 2024 23:04:04 for CbmRoot by
1.12.0