Fetch strings from a vector and return it as a single string. std::vector fetch: The vector. */
| 52 | std::vector<std::string> fetch: The vector. |
| 53 | */ |
| 54 | std::string StringUtils::FetchStringsFromVector(const std::vector<std::string> &fetch) { |
| 55 | std::string temp; |
| 56 | |
| 57 | if (fetch.size() < 1) return ""; // Smaller than 1 --> Return empty. |
| 58 | |
| 59 | for (int i = 0; i < (int)fetch.size(); i++) { |
| 60 | if (i != (int)fetch.size() - 1) { |
| 61 | temp += fetch[i] + ", "; |
| 62 | |
| 63 | } else { |
| 64 | temp += fetch[i]; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return temp; |
| 69 | } |
| 70 | |
| 71 | /* |
| 72 | adapted from GM9i's byte parsing. |