Panzer Version of the Day
Loading...
Searching...
No Matches
Panzer_STK_TransformBCNameForIOSS.cpp
Go to the documentation of this file.
3#include <algorithm>
4#include <cctype>
5
6std::string panzer_stk::transformBCNameForIOSS(std::string& name)
7{
8 // strip off leading and trailing whitespace just in case this comes
9 // in from input file.
10 panzer::trim(name);
11
12 // replace internal whitespace with underscores and upper case with lower case.
13 std::transform(name.begin(), name.end(), name.begin(),
14 [](const char c)
15 {
16 if (c == ' ')
17 return '_';
18 else
19 return char(std::tolower(c));
20 });
21 return name;
22}
std::string transformBCNameForIOSS(std::string &bc_name)
void trim(std::string &str)
Removes whitespace at beginning and end of string.