aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src/base/UUnicodeUtils.pas
diff options
context:
space:
mode:
Diffstat (limited to 'unicode/src/base/UUnicodeUtils.pas')
-rw-r--r--unicode/src/base/UUnicodeUtils.pas10
1 files changed, 10 insertions, 0 deletions
diff --git a/unicode/src/base/UUnicodeUtils.pas b/unicode/src/base/UUnicodeUtils.pas
index ce1731b6..29be778a 100644
--- a/unicode/src/base/UUnicodeUtils.pas
+++ b/unicode/src/base/UUnicodeUtils.pas
@@ -149,6 +149,11 @@ function UCS4UpperCase(const str: UCS4String): UCS4String; overload;
function UCS4CharToString(ch: UCS4Char): UCS4String;
{**
+ * @seealso System.Pos()
+ *}
+function UTF8Pos(const substr: UTF8String; const str: UTF8String): Integer;
+
+{**
* Copies a segment of str starting with Index (1-based) with Count characters (not bytes).
*}
function UTF8Copy(const str: UTF8String; Index: Integer = 1; Count: Integer = -1): UTF8String;
@@ -520,6 +525,11 @@ begin
Result[1] := 0;
end;
+function UTF8Pos(const substr: UTF8String; const str: UTF8String): Integer;
+begin
+ Result := Pos(substr, str);
+end;
+
function UTF8Copy(const str: UTF8String; Index: Integer; Count: Integer): UTF8String;
begin
Result := UCS4ToUTF8String(UCS4Copy(UTF8ToUCS4String(str), Index-1, Count));