| 847 | } |
| 848 | |
| 849 | int 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 | |
| 868 | int String::get_slice_count(const char *p_splitter) const { |
| 869 | if (is_empty()) { |