String¶
String related methods
AnsiString.Pos¶
function AnsiString.Pos(SubStr: String): Int32; constref;
Returns the position of the position of the first occurance of the substring
AnsiString.PosR¶
function AnsiString.PosR(SubStr: String): Int32; constref;
Returns the position of the position of the last occurance of the substring
AnsiString.PosEx¶
function AnsiString.PosEx(SubStr: String): TIntegerArray; constref;
Returns the position of every occurance of the substring
AnsiString.Startswith¶
function AnsiString.Startswith(Prefix: String): Boolean; constref;
Returns True
if the string starts with the given string Prefix
AnsiString.Endswith¶
function AnsiString.Endswith(Suffix: String): Boolean; constref;
Returns True
if the string ends with the given string Suffix
AnsiString.Capitalize¶
function AnsiString.Capitalize(): String; constref;
Returns the string with every word captalized
AnsiString.Upper¶
function AnsiString.Upper(): String; constref;
Returns the string with every character converted to uppercase
AnsiString.Lower¶
function AnsiString.Lower(): String; constref;
Returns the string with every character converted to lowercase
AnsiString.After¶
function AnsiString.After(SubStr: String): String; constref;
Copy the string from after the first occurrence of SubStr
AnsiString.Before¶
function AnsiString.Before(SubStr: String): String; constref;
Copy the string from before the first occurrence of SubStr
AnsiString.Count¶
function AnsiString.Count(Str: String): Int32; constref;
Count the number of occurrences of the given string.
AnsiString.Replace¶
function AnsiString.Replace(SubStr, ReplaceStr: String; Flags: TReplaceFlags=[rfReplaceAll]): String; constref;
Replace [all by default] occurrences of the given SubStr with with ReplaceStr
AnsiString.Explode¶
function AnsiString.Explode(Delimiter: String): TStringArray; constref;
Blow up the string at each delimiter into smaller strings
AnsiString.IsAlphaNum¶
function AnsiString.IsAlphaNum(): Boolean; constref;
Test if a string only contains alpha numerical characters.
AnsiString.IsFloat¶
function AnsiString.IsFloat(): Boolean; constref;
Test if a string is a floating point number
AnsiString.IsAlpha¶
function AnsiString.IsAlpha(): Boolean; constref;
Test if a string only contains letters a-zA-Z
AnsiString.ExtractNumbers¶
function AnsiString.ExtractNumbers(): TExtendedArray; constref;
Extract all the numbers found in the string, as there could be floating point numbers as well it reutnrs a TExtendedArray.
AnsiString.ExtractNumbersEx¶
function AnsiString.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 * int32¶
operator * (left:AnsiString; Right:Int32): String;
Replicates the string the given amount of times. So 'ho!' * 3
would generate ho!ho!ho!
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