--- parser3/src/main/pa_string.C 2026/01/06 13:07:58 1.284 +++ parser3/src/main/pa_string.C 2026/10/01 11:48:37 1.286 @@ -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.286 2026/10/01 11:48:37 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; @@ -620,6 +620,22 @@ String& String::change_case(Charset& sou result.langs=langs; result.body=String::Body(new_cstr); + return result; +} + +String& String::change_char(char from, char to) const { + String& result=*new String(); + if(is_empty()) + return result; + + char* new_cstr=cstrm(); + for(char* c=new_cstr; *c; c++) + if(*c==from) + *c=to; + + result.langs=langs; + result.body=String::Body(new_cstr); + return result; }