Hello,

I love the helper functions from SysUtils' `TStringHelper`. Unfortunately, 
they're only available for `String`, but not for other types like `Utf8String` 
or `RawByteString`.

Is it safe to cast to `String()` and then invoking the helper, e.g. 
`String(AUtf8String).IndexOf('foo')`? Or does this casting involve a codepage 
conversion?

I've tried with my FPC installation:

program Project1;
uses sysutils;
var S: Utf8string;
begin
  S := 'äfoo';
  writeln (String(S).IndexOf('f')); // prints "2", as expected
end.

But can I rely on it?

Are there any plans of making string helpers available for `Utf8String` and 
`RawByteString`?

Kind regards,
Thomas

_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to