String

String related methods


String.Len

function String.Len(): Int32; constref;

Returns the length of the string


String.Pos

function String.Pos(SubStr: String): Int32; constref;

Returns the position of the position of the first occurance of the substring


String.PosR

function String.PosR(SubStr: String): Int32; constref;

Returns the position of the position of the last occurance of the substring


String.PosEx

function String.PosEx(SubStr: String): TIntegerArray; constref;

Returns the position of every occurance of the substring


String.Contains

function String.Contains(subString: String): Boolean; constref;

Returns true if the substring exists on the string.


String.ContainsAny

function String.ContainsAny(subStrings: TStringArray): Boolean; constref;

Returns true if any of the substrings exists on the string.


String.ContainsAll

function String.ContainsAll(subStrings: TStringArray): Boolean; constref;

Returns true if all of the substrings exist on the string.


String.Startswith

function String.Startswith(Prefix: String): Boolean; constref;

Returns True if the string starts with the given string Prefix


String.Endswith

function String.Endswith(Suffix: String): Boolean; constref;

Returns True if the string ends with the given string Suffix


String.Capitalize

function String.Capitalize(): String; constref;

Returns the string with every word captalized


String.Upper

function String.Upper(): String; constref;

Returns the string with every character converted to uppercase


String.Lower()

function String.Lower(): String; constref;
function String.ToLower(): String; constref;

Returns the string with every character converted to lowercase


String.After

function String.After(SubStr: String): String; constref;

Copy the string from after the first occurrence of SubStr


String.Before

function String.Before(SubStr: String): String; constref;

Copy the string from before the first occurrence of SubStr


String.Count

function String.Count(Str: String): Int32; constref;

Count the number of occurrences of the given string.


String.Replace

function String.Replace(SubStr, ReplaceStr: String; Flags: TReplaceFlags=[rfReplaceAll]): String; constref;

Replace [all by default] occurrences of the given SubStr with with ReplaceStr


String.Split

function String.Split(delimiter: String): TStringArray; constref;

Split up the string at each delimiter into smaller strings


String.Trim

function String.Trim(chars:String = STR_WHITESPACE): String; constref;
function String.Strip(chars:String = STR_WHITESPACE): String; constref;

Return a copy of the string with leading and trailing characters removed.


String.IsAlphaNum

function String.IsAlphaNum(): Boolean; constref;

Test if a string only contains alpha numerical characters.


String.IsDigit

function String.IsDigit(): Boolean; constref;

Test if a sting is a digit


String.IsFloat

function String.IsFloat(): Boolean; constref;

Test if a string is a floating point number


String.IsAlpha

function String.IsAlpha(): Boolean; constref;

Test if a string only contains letters a-zA-Z


String.ExtractNumbers

function String.ExtractNumbers(): TExtendedArray; constref;

Extract all the numbers found in the string, as there could be floating point numbers as well it reutnrs a TExtendedArray.


String.ExtractNumbersEx

function String.ExtractNumbersEx(): TExtendedArray; constref;

Extract all the numbers found in the string, this time every number ends up in each their index. For example '1234' would return [1,2,3,4]


String.FileExt

function String.FileExt(): String; constref;

Returns the file extension


String.FileName

function String.FileName(): String; constref;

Returns the file name


String.Hex

function String.Hex(): string; constref;

Returns the hexadecimal value that represents the string.


operator string * int32

operator * (left:String; Right:Int32): String;

Replicates the string the given amount of times. So 'ho!' * 3 would generate ho!ho!ho!


operator string in string

operator in (left:String; Right:String): Boolean;

Returns True if the string exists in the other string. So 'hell' in 'hello world' would be True