MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_slice_count

Method get_slice_count

core/string/ustring.cpp:849–866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

847}
848
849int String::get_slice_count(const String &p_splitter) const {
850 if (is_empty()) {
851 return 0;
852 }
853 if (p_splitter.is_empty()) {
854 return 0;
855 }
856
857 int pos = 0;
858 int slices = 1;
859
860 while ((pos = find(p_splitter, pos)) >= 0) {
861 slices++;
862 pos += p_splitter.length();
863 }
864
865 return slices;
866}
867
868int String::get_slice_count(const char *p_splitter) const {
869 if (is_empty()) {

Callers 15

set_color_regionsMethod · 0.80
_action_pressedMethod · 0.80
update_file_listMethod · 0.80
_update_popup_menuMethod · 0.80
_set_delimitersMethod · 0.80
_update_cacheMethod · 0.80
debugMethod · 0.80
_parse_ipv4Method · 0.80
IPAddressMethod · 0.80
parse_urlMethod · 0.80
capitalizeMethod · 0.80

Calls 4

findFunction · 0.85
strlenFunction · 0.85
is_emptyMethod · 0.45
lengthMethod · 0.45

Tested by 1

update_treeMethod · 0.64