301 return strncmp (chars() + ofs, other.chars(), other.length()) == 0; |
301 return strncmp (chars() + ofs, other.chars(), other.length()) == 0; |
302 } |
302 } |
303 |
303 |
304 // ------------------------------------------------------------------------------------------------- |
304 // ------------------------------------------------------------------------------------------------- |
305 // |
305 // |
306 bool String::starts_with (const String& other) |
306 bool String::starts_with (const String& other) const |
307 { |
307 { |
308 if (length() < other.length()) |
308 if (length() < other.length()) |
309 return false; |
309 return false; |
310 |
310 |
311 return strncmp (chars(), other.chars(), other.length()) == 0; |
311 return strncmp (chars(), other.chars(), other.length()) == 0; |