MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / getLastNumber

Function getLastNumber

src/openpose/utilities/string.cpp:8–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace op
7{
8 unsigned long long getLastNumber(const std::string& string)
9 {
10 try
11 {
12 const auto stringNumber = string.substr(string.find_last_not_of("0123456789") + 1);
13 return std::stoull(stringNumber);
14 }
15 catch (const std::exception& e)
16 {
17 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
18 return 0ull;
19 }
20 }
21
22 template<typename T>
23 std::string toFixedLengthString(const T number, const unsigned long long stringLength)

Callers 1

Calls 2

whatMethod · 0.80
errorFunction · 0.70

Tested by

no test coverage detected