MFString MFString::GetExtension() const { int dot = FindCharReverse('.'); if(dot > FindCharReverse('/') && dot > FindCharReverse('\\')) return SubStr(dot); return MFString(); }
void String::TruncateToRightSection(char separator, bool exclude_separator) { if (_meta && separator) { size_t slice_at = FindCharReverse(separator); if (slice_at != -1) { TruncateToRight(exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at); } } }
MFString& MFString::TruncateExtension() { int dot = FindCharReverse('.'); if(dot >= 0) { pData->pMemory[dot] = 0; pData->bytes = dot; } return *this; }
void String::ClipRightSection(char separator, bool include_separator) { if (_meta && separator) { size_t slice_at = FindCharReverse(separator); if (slice_at != -1) { ClipRight(include_separator ? _meta->Length - slice_at : _meta->Length - slice_at - 1); } else Empty(); } }
String String::RightSection(char separator, bool exclude_separator) const { if (_meta && separator) { size_t slice_at = FindCharReverse(separator); if (slice_at != -1) { size_t count = exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at; return Right(count); } } return *this; }
// Extract rightmost part, separated by the given char String String::RightSection(char separator, bool exclude_separator) const { if (_meta && separator) { int slice_at = FindCharReverse(separator); if (slice_at >= 0) { int count = exclude_separator ? _meta->Length - slice_at - 1 : _meta->Length - slice_at; return Right(count); } } return String(); }