MCPcopy Create free account
hub / github.com/catboost/catboost / CutExtension

Function CutExtension

util/folder/pathsplit.cpp:135–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135TStringBuf CutExtension(const TStringBuf fileName Y_LIFETIME_BOUND) {
136 if (fileName.empty()) {
137 return fileName;
138 }
139
140 TStringBuf name;
141 TStringBuf extension;
142 fileName.RSplit('.', name, extension);
143 if (name.empty()) {
144 // dot at a start or not found
145 return name;
146 } else {
147 return extension;
148 }
149}

Callers 1

ExtensionMethod · 0.85

Calls 2

RSplitMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected