--- parser3/src/main/pa_string.C 2026/01/06 13:07:58 1.284 +++ parser3/src/main/pa_string.C 2026/11/01 14:41:57 1.288 @@ -1,7 +1,7 @@ /** @file Parser: string class. @see untalength_t.C. - Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ @@ -12,7 +12,7 @@ #include "pa_charset.h" #include "pa_vregex.h" -volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.284 2026/01/06 13:07:58 moko Exp $" IDENT_PA_STRING_H; +volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.288 2026/11/01 14:41:57 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; @@ -271,6 +271,22 @@ size_t String::Body::strrpbrk(const char return STRING_NOT_FOUND; } +size_t String::Body::rpos(const Body substr, size_t offset) const { + size_t substr_length=substr.length(); + if(!substr_length || substr_length>length()) + return STRING_NOT_FOUND; // empty substr is not found, as in pos + + const char* self_str=cstr(); + const char* substr_str=substr.cstr(); + + size_t last=length()-substr_length; // the last position substr fits at + for(size_t i=(offset