The full source code attached.
A few test statements:
function TestStrings()
begin
dim as int char8=1, char16=2, all=-1;
dim as StringObject uo=NewString(0,char8);
dim as StringObject vo=NewString(0,char8);
dim as StringObject wo=NewString(100,char8);
dim as StringMethods sm=vo->StringMethods;
sm->Show(vo);
sm->SetChars(&uo,"LO",all,char8);
sm->SetChars(&vo," HellO ",all,char8);
sm->Ltrim(&vo,vo);
sm->Rtrim(&vo,vo);
sm->Ucase(&vo,vo);
sm->Join(&wo,3,vo,vo,vo);
sm->Show(uo);
sm->Show(vo);
sm->Show(wo);
printf("%i\n",sm->Instr(6,wo,uo));
sm->Lcase(&wo,wo);
sm->Insert(&wo,uo,6);
sm->Show(wo);
sm->Delete(&wo,6,2);
sm->Show(wo);
sm->Str(&vo,42.0);
sm->Show(vo);
double v=sm->Val(vo);
printf("%f\n",v);
sm->SetChars(&vo,"Abc",all,char8);
sm->Repeat(&wo,vo,7);
sm->Show(wo);
sm->Replace(&wo,vo,uo);
sm->Show(wo);
sm->Replace(&wo,uo,vo);
sm->Show(wo);
sm->SetChars(&uo,"<",all,char8);
sm->SetChars(&vo,">",all,char8);
sm->SetChars(&wo," Hello World! ",all,char8);
sm->Show(uo);
sm->Show(vo);
sm->Show(wo);
sm->Join(&wo,3,uo,sm->Ltrim(&wo,sm->Rtrim(&wo,sm->Ucase(&wo,wo))),vo);
sm->Show(wo);
sm->Join(&wo,3,uo,wo,vo);
sm->Set(&vo,wo);
sm->Show(vo);
sm->GetMid(&vo,wo,3,6,1);
sm->Show(vo);
sm->SetMid(&vo,6,vo);
sm->Show(vo);
StringFree(&uo);
StringFree(&vo);
StringFree(&wo);
end