Imprment string trimr to remove spaces at the end of aircraft name.

(cherry picked from commit 70fd4039938cdd45f03d541e0aff1238de85fb3e)
This commit is contained in:
heurist1 2023-02-28 19:04:03 +00:00
parent 567fee1d98
commit ef151e243b
2 changed files with 9 additions and 0 deletions

View File

@ -255,3 +255,9 @@ double get_decimals(double num, int16_t mult, bool round) {
if (num > .5) intnum++; //Round up
return intnum;
}
std::string trimr(std::string str)
{
size_t last = str.find_last_not_of(' ');
return (last!=std::string::npos) ? str.substr(0, last+1) : ""; // Remove the trailing spaces
}

View File

@ -58,4 +58,7 @@ std::string to_string_FAT_timestamp(const FATTimestamp& timestamp);
std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precision);
double get_decimals(double num, int16_t mult, bool round = false); //euquiq added
std::string trimr(std::string str); // Remove trailing spaces
#endif/*__STRING_FORMAT_H__*/