sources/mystring.cpp

changeset 107
ca10837a2a9e
parent 105
b4466472aecd
child 108
5900be70c619
child 109
e4966d7e615d
equal deleted inserted replaced
105:b4466472aecd 107:ca10837a2a9e
313 return strncmp (chars() + ofs, other.chars(), other.length()) == 0; 313 return strncmp (chars() + ofs, other.chars(), other.length()) == 0;
314 } 314 }
315 315
316 // ------------------------------------------------------------------------------------------------- 316 // -------------------------------------------------------------------------------------------------
317 // 317 //
318 bool String::starts_with (const String& other) 318 bool String::starts_with (const String& other) const
319 { 319 {
320 if (length() < other.length()) 320 if (length() < other.length())
321 return false; 321 return false;
322 322
323 return strncmp (chars(), other.chars(), other.length()) == 0; 323 return strncmp (chars(), other.chars(), other.length()) == 0;
507 m_string = ""; 507 m_string = "";
508 else if (a != 0 or b != length() - 1) 508 else if (a != 0 or b != length() - 1)
509 m_string = m_string.substr (a, b - a + 1); 509 m_string = m_string.substr (a, b - a + 1);
510 } 510 }
511 511
512 // -------------------------------------------------------------------------------------------------
513 //
514 String String::normalized (int (*filter)(int)) const
515 {
516 String result = *this;
517 result.normalize(filter);
518 return result;
519 }
520
512 END_ZFC_NAMESPACE 521 END_ZFC_NAMESPACE

mercurial