Closed IndrajeetPatil closed 2 years ago
I am not sure as well. 18 years old code, lol
It used to lower case other letters...
Just needs one extra line of code then:
#include "FuncParser/StringHelper.h"
#include <string>
#include <algorithm>
namespace FuncParserNative
{
std::string StringHelper::Capitalize (const std::string & pInString)
{
std::string newString = pInString;
newString[0] = toupper(pInString[0]);
std::transform(newString.begin() + 1, newString.end(), newString.begin() + 1, ::tolower);
return newString;
}
}//.. end "namespace FuncParserNative"
I think. I will make a new PR.
@Yuri05 I am not sure why you are heap allocating the new string.
If there is no special reason, this is a much simpler solution.