Today I was fixing up some warnings in our code and one of them is "W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString'" in ContainsStr
function.
After searching for a while for an equivalent of this function which takes two unicode strings as an argument I've decided to ask here. I would expect to find something like ContainsWideStr
(for Delphi 2007 and lower) or ContainsUnicodeStr
(for Delphi 2009+) but I couldn't find any of these.
I know I could just do something like this on my own:
function ContainsUnicodeStr(const AText, ASubText: String): Boolean;
begin
Result := Pos(ASubText, AText) > 0;
end;
However, I would like to avoid duplication of code which is already in Delphi, but I simply do not know where.