MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / TrimString

Function TrimString

formatter/generic/genericformatter.cpp:27–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27static string TrimString(const string& str)
28{
29 size_t startPos = 0;
30 size_t endPos = 0;
31
32 bool start = true;
33 for (size_t i = 0; i < str.size(); i++)
34 {
35 if (isspace(str[i]))
36 {
37 if (start)
38 {
39 startPos = i + 1;
40 endPos = i + 1;
41 }
42 }
43 else
44 {
45 start = false;
46 endPos = i + 1;
47 }
48 }
49
50 return str.substr(startPos, endPos - startPos);
51}
52
53
54static string TrimLeadingWhitespace(const string& str)

Callers 2

GetOperatorPrecedenceFunction · 0.85
FormatLinesMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected