diff --git a/srcs/HandleString/HandlingString.cpp b/srcs/HandleString/HandlingString.cpp index 7f56d25b..d1118b4c 100644 --- a/srcs/HandleString/HandlingString.cpp +++ b/srcs/HandleString/HandlingString.cpp @@ -204,3 +204,8 @@ std::string HandlingString::obtain_afterword(const std::string other, char delim { return other.substr(other.find(delimiter) + 1); } + +double HandlingString::obtain_weight(const std::string &other) +{ + return (HandlingString::str_to_double(HandlingString::obtain_afterword(other, '='))); +} diff --git a/srcs/includes/HandlingString.hpp b/srcs/includes/HandlingString.hpp index bfbc85cf..6a4e7753 100644 --- a/srcs/includes/HandlingString.hpp +++ b/srcs/includes/HandlingString.hpp @@ -30,6 +30,7 @@ class HandlingString static void ft_strcpy(char *input_memory, std::string const &sub); static std::string obtain_beforeword(const std::string other, char delimiter); static std::string obtain_afterword(const std::string other, char delimiter); + static double obtain_weight(const std::string &other); }; #endif \ No newline at end of file