MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / lstrip

Method lstrip

include/stringzilla/stringzilla.hpp:2502–2507  ·  view source on GitHub ↗

* @brief Python-like convenience function, dropping prefix formed of given characters. * @see Similar to `boost::algorithm::trim_left_if(str, is_any_of(set))`. */

Source from the content-addressed store, hash-verified

2500 * @see Similar to `boost::algorithm::trim_left_if(str, is_any_of(set))`.
2501 */
2502 string_slice lstrip(byteset set) const noexcept {
2503 set = set.inverted();
2504 auto new_start = (pointer)sz_find_byteset(start_, length_, &set.raw());
2505 return new_start ? string_slice {new_start, length_ - static_cast<size_type>(new_start - start_)}
2506 : string_slice();
2507 }
2508
2509 /**
2510 * @brief Python-like convenience function, dropping suffix formed of given characters.

Callers 3

test_unit_stripFunction · 0.80
test_searchFunction · 0.80
basic_stringClass · 0.80

Calls 3

rawMethod · 0.80
sz_find_bytesetFunction · 0.70
invertedMethod · 0.45

Tested by 2

test_unit_stripFunction · 0.64
test_searchFunction · 0.64