MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / ends_with

Method ends_with

modules/gui/gui/src/backend/text_server/ustring.cpp:3807–3832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3805}
3806
3807bool String::ends_with(const String& p_string) const
3808{
3809 int l = p_string.length();
3810 if (l > length())
3811 {
3812 return false;
3813 }
3814
3815 if (l == 0)
3816 {
3817 return true;
3818 }
3819
3820 const char32_t* p = &p_string[0];
3821 const char32_t* s = &operator[](length() - l);
3822
3823 for (int i = 0; i < l; i++)
3824 {
3825 if (p[i] != s[i])
3826 {
3827 return false;
3828 }
3829 }
3830
3831 return true;
3832}
3833
3834bool String::begins_with(const String& p_string) const
3835{

Callers 2

trim_suffixMethod · 0.45
path_toMethod · 0.45

Calls 2

lengthFunction · 0.50
lengthMethod · 0.45

Tested by

no test coverage detected