MCPcopy Create free account
hub / github.com/crawl/crawl / strip_suffix

Function strip_suffix

crawl-ref/source/stringutil.cc:306–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306bool strip_suffix(string &s, const string &suffix)
307{
308 if (ends_with(s, suffix))
309 {
310 s.erase(s.length() - suffix.length(), suffix.length());
311 trim_string(s);
312 return true;
313 }
314 return false;
315}
316
317string replace_all(string s, const string &find, const string &repl)
318{

Callers 15

parse_corpse_specMethod · 0.85
_spell_filterFunction · 0.85
_ability_filterFunction · 0.85
_status_filterFunction · 0.85
_mutation_filterFunction · 0.85
_bane_filterFunction · 0.85
_passive_filterFunction · 0.85
_recap_ability_keysFunction · 0.85
key_to_menu_strMethod · 0.85
_describe_keyFunction · 0.85
get_feature_descFunction · 0.85

Calls 2

ends_withFunction · 0.70
eraseMethod · 0.45

Tested by

no test coverage detected