String
Overview
Represents text as a series of Unicode characters. String is immutable (read-only) all methods that modifies content of a string returns a new copy.
Instantinating a String
Please note, that you need to directly specify Sugar.String type when instantinating string by assigning string litteral, for example:
var PlatfromString := "String";
var SugarString: Sugar.String := "String";
Compiler will create an instance of a platform specific string when you are using var
, so in this sample PlatformString
will became a System.String
, java.lang.String
or NSString
depending on your current platform. By specifing a type you will tell compiler to cast string to a Sugar type.
This needed only when declaring string as shown in example, otherwise compiler will cast string litteral automatically, for example:
method DoSomething(Value: Sugar.String);
begin
//Do something
end;
DoSomething("String"); //casted automatically, no need to manually change it
Location
- Reference: Sugar
- Namespace: Sugar
Creates a new instance of the class with specified array.
constructor(Value: array of Byte; Encoding: Encoding)
String(Byte[] Value, Encoding Encoding)
init(_ Value: Byte..., _ Encoding: Encoding)
String(Byte[] Value, Encoding Encoding)
Sub New(Value As Byte(), Encoding As Encoding)
Parameters:
- Value: Array of byte
- Encoding:
constructor (array of Char)
Creates a new instance of the class with specified array.
constructor(Value: array of Char)
String(Char[] Value)
init(_ Value: Char...)
String(Char[] Value)
Sub New(Value As Char())
Parameters:
- Value: Array of char.
constructor(Value: array of Char; Offset: Int32; Count: Int32)
String(Char[] Value, Int32 Offset, Int32 Count)
init(_ Value: Char..., _ Offset: Int32, _ Count: Int32)
String(Char[] Value, Int32 Offset, Int32 Count)
Sub New(Value As Char(), Offset As Int32, Count As Int32)
Parameters:
- Value:
- Offset:
- Count:
constructor(aChar: Char; aCount: Int32)
String(Char aChar, Int32 aCount)
init(_ aChar: Char, _ aCount: Int32)
String(Char aChar, Int32 aCount)
Sub New(aChar As Char, aCount As Int32)
Parameters:
- aChar:
- aCount:
CharacterIsWhiteSpace
Checks whether specified character is a whitespace.
class method CharacterIsWhiteSpace(Value: Char): Boolean
static Boolean CharacterIsWhiteSpace(Char Value)
static func CharacterIsWhiteSpace(_ Value: Char) -> Boolean
static Boolean CharacterIsWhiteSpace(Char Value)
Shared Function CharacterIsWhiteSpace(Value As Char) As Boolean
Parameters:
- Value: Character to check.
Chars
Gets a character withing the string with specified index.
property Chars[aIndex: Int32]: Char read;
Char Chars[Int32 aIndex] { get; }
subscript Chars(_ aIndex: Int32) -> Char { get{} }
Char Chars[Int32 aIndex] { __get; }
ReadOnly Property Chars(aIndex As Int32) As Char
CompareTo mapped
Compares specified String object with the current string. The result is a negative integer if current string precedes the argument string. The result is a positive integer if current string follows the argument string. The result is zero if the strings are equal.
method CompareTo(Value: String): Int32
Int32 CompareTo(String Value)
func CompareTo(_ Value: String) -> Int32
Int32 CompareTo(String Value)
Function CompareTo(Value As String) As Int32
Parameters:
- Value: The string to compare.
CompareToIgnoreCase mapped
Compares specified String object with the current string, ignoring case differences. The result is a negative integer if current string precedes the argument string. The result is a positive integer if current string follows the argument string. The result is zero if the strings are equal.
method CompareToIgnoreCase(Value: String): Int32
Int32 CompareToIgnoreCase(String Value)
func CompareToIgnoreCase(_ Value: String) -> Int32
Int32 CompareToIgnoreCase(String Value)
Function CompareToIgnoreCase(Value As String) As Int32
Parameters:
- Value: The string to compare.
Contains mapped
Returns a value indicating whether a specified substring occurs within this string.
method Contains(Value: String): Boolean
Boolean Contains(String Value)
func Contains(_ Value: String) -> Boolean
Boolean Contains(String Value)
Function Contains(Value As String) As Boolean
Parameters:
- Value: The string to seek.
EndsWith mapped
Returns a value indicating whether current string ends with a specified string.
method EndsWith(Value: String; IgnoreCase: Boolean): Boolean
Boolean EndsWith(String Value, Boolean IgnoreCase)
func EndsWith(_ Value: String, _ IgnoreCase: Boolean) -> Boolean
Boolean EndsWith(String Value, Boolean IgnoreCase)
Function EndsWith(Value As String, IgnoreCase As Boolean) As Boolean
Parameters:
- Value: The string to seek.
- IgnoreCase:
class method Equals(ValueA: String; ValueB: String): Boolean
static Boolean Equals(String ValueA, String ValueB)
static func Equals(_ ValueA: String, _ ValueB: String) -> Boolean
static Boolean Equals(String ValueA, String ValueB)
Shared Function Equals(ValueA As String, ValueB As String) As Boolean
Parameters:
- ValueA:
- ValueB:
Determines whether current string and another specified String object have the same value.
method Equals(Value: String): Boolean
Boolean Equals(String Value)
func Equals(_ Value: String) -> Boolean
Boolean Equals(String Value)
Function Equals(Value As String) As Boolean
Parameters:
- Value: The string to compare.
class method EqualsIgnoringCase(ValueA: String; ValueB: String): Boolean
static Boolean EqualsIgnoringCase(String ValueA, String ValueB)
static func EqualsIgnoringCase(_ ValueA: String, _ ValueB: String) -> Boolean
static Boolean EqualsIgnoringCase(String ValueA, String ValueB)
Shared Function EqualsIgnoringCase(ValueA As String, ValueB As String) As Boolean
Parameters:
- ValueA:
- ValueB:
Determines whether current string and another specified String object have the same value, ignoring case differences..
method EqualsIgnoringCase(Value: String): Boolean
Boolean EqualsIgnoringCase(String Value)
func EqualsIgnoringCase(_ Value: String) -> Boolean
Boolean EqualsIgnoringCase(String Value)
Function EqualsIgnoringCase(Value As String) As Boolean
Parameters:
- Value: The string to compare.
class method EqualsIgnoringCaseInvariant(ValueA: String; ValueB: String): Boolean
static Boolean EqualsIgnoringCaseInvariant(String ValueA, String ValueB)
static func EqualsIgnoringCaseInvariant(_ ValueA: String, _ ValueB: String) -> Boolean
static Boolean EqualsIgnoringCaseInvariant(String ValueA, String ValueB)
Shared Function EqualsIgnoringCaseInvariant(ValueA As String, ValueB As String) As Boolean
Parameters:
- ValueA:
- ValueB:
method EqualsIgnoringCaseInvariant(Value: String): Boolean
Boolean EqualsIgnoringCaseInvariant(String Value)
func EqualsIgnoringCaseInvariant(_ Value: String) -> Boolean
Boolean EqualsIgnoringCaseInvariant(String Value)
Function EqualsIgnoringCaseInvariant(Value As String) As Boolean
Parameters:
- Value:
Format
Replaces the format item in a specified string with the string representation of a corresponding object in a specified array.
Each format item takes the following form and consists of the following components: {Index[,Alignment][:FormatSecifier]}
- Index - zero based index in the array.
- Alignment - optional, signed integer indicating the preferred formatted field width. If value is less than the length of the formatted string, alignment is ignored otherwise string is extended with space character either left or right, depending on a sign.
- FormatSpecifier - currently ignored.
Please note, currently string supports only basic formating and align, no data specific transformations will be applied.
String.Format("First {0} Third", 2); //results in "First 2 Third"
String.Format("{0,7}", "Text"); //results in " Text"
String.Format("{0:X4}", 255); //results in "255", format specifier is ignored.
class method Format(aFormat: String; params aParams: array of Object): not nullable String
static String! Format(String aFormat, params Object[] aParams)
static func Format(_ aFormat: String, _ aParams: Object...) -> String
static String Format(String aFormat, Object[]... aParams)
Shared Function Format(aFormat As String, ParamArray aParams As Object()) As String
Parameters:
- aFormat: Format of a new string.
- aParams: Array of objects to format.
method IndexOf(Value: String; StartIndex: Int32): Int32
Int32 IndexOf(String Value, Int32 StartIndex)
func IndexOf(_ Value: String, _ StartIndex: Int32) -> Int32
Int32 IndexOf(String Value, Int32 StartIndex)
Function IndexOf(Value As String, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
method IndexOf(Value: Char; StartIndex: Int32): Int32
Int32 IndexOf(Char Value, Int32 StartIndex)
func IndexOf(_ Value: Char, _ StartIndex: Int32) -> Int32
Int32 IndexOf(Char Value, Int32 StartIndex)
Function IndexOf(Value As Char, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
method IndexOfAny(AnyOf: array of Char): Int32
Int32 IndexOfAny(Char[] AnyOf)
func IndexOfAny(_ AnyOf: Char...) -> Int32
Int32 IndexOfAny(Char[] AnyOf)
Function IndexOfAny(AnyOf As Char()) As Int32
Parameters:
- AnyOf:
method IndexOfAny(AnyOf: array of Char; StartIndex: Int32): Int32
Int32 IndexOfAny(Char[] AnyOf, Int32 StartIndex)
func IndexOfAny(_ AnyOf: Char..., _ StartIndex: Int32) -> Int32
Int32 IndexOfAny(Char[] AnyOf, Int32 StartIndex)
Function IndexOfAny(AnyOf As Char(), StartIndex As Int32) As Int32
Parameters:
- AnyOf:
- StartIndex:
IsNullOrEmpty
Checks whether specified string is nil
or contains no data.
class method IsNullOrEmpty(Value: String): Boolean
static Boolean IsNullOrEmpty(String Value)
static func IsNullOrEmpty(_ Value: String) -> Boolean
static Boolean IsNullOrEmpty(String Value)
Shared Function IsNullOrEmpty(Value As String) As Boolean
Parameters:
- Value: The string to check.
IsNullOrWhiteSpace
Checks whether specified string is nil
or contains only whit space characters.
class method IsNullOrWhiteSpace(Value: String): Boolean
static Boolean IsNullOrWhiteSpace(String Value)
static func IsNullOrWhiteSpace(_ Value: String) -> Boolean
static Boolean IsNullOrWhiteSpace(String Value)
Shared Function IsNullOrWhiteSpace(Value As String) As Boolean
Parameters:
- Value: The string to check.
Join
class method Join(Separator: String; Values: array of String): String
static String Join(String Separator, String[] Values)
static func Join(_ Separator: String, _ Values: String...) -> String
static String Join(String Separator, String[] Values)
Shared Function Join(Separator As String, Values As String()) As String
Parameters:
- Separator:
- Values:
Finds the zero-based index of the last occurrence of the specified string in the current string or -1
if it wasn't found.
method LastIndexOf(Value: String): Int32
Int32 LastIndexOf(String Value)
func LastIndexOf(_ Value: String) -> Int32
Int32 LastIndexOf(String Value)
Function LastIndexOf(Value As String) As Int32
Parameters:
- Value: The string to seek.
method LastIndexOf(Value: Char): Int32
Int32 LastIndexOf(Char Value)
func LastIndexOf(_ Value: Char) -> Int32
Int32 LastIndexOf(Char Value)
Function LastIndexOf(Value As Char) As Int32
Parameters:
- Value:
method LastIndexOf(Value: String; StartIndex: Int32): Int32
Int32 LastIndexOf(String Value, Int32 StartIndex)
func LastIndexOf(_ Value: String, _ StartIndex: Int32) -> Int32
Int32 LastIndexOf(String Value, Int32 StartIndex)
Function LastIndexOf(Value As String, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
method LastIndexOf(Value: Char; StartIndex: Int32): Int32
Int32 LastIndexOf(Char Value, Int32 StartIndex)
func LastIndexOf(_ Value: Char, _ StartIndex: Int32) -> Int32
Int32 LastIndexOf(Char Value, Int32 StartIndex)
Function LastIndexOf(Value As Char, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
Length
property Length: Int32 read;
Int32 Length { get; }
var Length: Int32 { get{} }
Int32 Length { __get; }
ReadOnly Property Length() As Int32
PadEnd mapped
method PadEnd(TotalWidth: Int32; PaddingChar: Char): String
String PadEnd(Int32 TotalWidth, Char PaddingChar)
func PadEnd(_ TotalWidth: Int32, _ PaddingChar: Char) -> String
String PadEnd(Int32 TotalWidth, Char PaddingChar)
Function PadEnd(TotalWidth As Int32, PaddingChar As Char) As String
Parameters:
- TotalWidth:
- PaddingChar:
PadStart mapped
method PadStart(TotalWidth: Int32; PaddingChar: Char): String
String PadStart(Int32 TotalWidth, Char PaddingChar)
func PadStart(_ TotalWidth: Int32, _ PaddingChar: Char) -> String
String PadStart(Int32 TotalWidth, Char PaddingChar)
Function PadStart(TotalWidth As Int32, PaddingChar As Char) As String
Parameters:
- TotalWidth:
- PaddingChar:
Replace mapped
Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string.
method Replace(OldValue: String; NewValue: String): not nullable String
String! Replace(String OldValue, String NewValue)
func Replace(_ OldValue: String, _ NewValue: String) -> String
String Replace(String OldValue, String NewValue)
Function Replace(OldValue As String, NewValue As String) As String
Parameters:
- OldValue: The string to be replaced.
- NewValue: The string to replace with.
Split mapped
Returns a string array that contains the substrings in the current string that are delimited by specified separator.
method Split(Separator: String): array of String
String[] Split(String Separator)
func Split(_ Separator: String) -> String...
String[] Split(String Separator)
Function Split(Separator As String) As String()
Parameters:
- Separator: String that delimits the substrings in the current string.
StartsWith mapped
Returns a value indicating whether current string starts with a specified string.
method StartsWith(Value: String; IgnoreCase: Boolean): Boolean
Boolean StartsWith(String Value, Boolean IgnoreCase)
func StartsWith(_ Value: String, _ IgnoreCase: Boolean) -> Boolean
Boolean StartsWith(String Value, Boolean IgnoreCase)
Function StartsWith(Value As String, IgnoreCase As Boolean) As Boolean
Parameters:
- Value: The string to seek.
- IgnoreCase:
Retrieves a substring from current string. The substring starts at a specified position and continues to the end of the string.
method Substring(StartIndex: Int32): not nullable String
String! Substring(Int32 StartIndex)
func Substring(_ StartIndex: Int32) -> String
String Substring(Int32 StartIndex)
Function Substring(StartIndex As Int32) As String
Parameters:
- StartIndex: Starting position of a substring.
Retrieves a substring from current string. The substring starts at a specified position and has specified length.
method Substring(StartIndex: Int32; aLength: Int32): not nullable String
String! Substring(Int32 StartIndex, Int32 aLength)
func Substring(_ StartIndex: Int32, _ aLength: Int32) -> String
String Substring(Int32 StartIndex, Int32 aLength)
Function Substring(StartIndex As Int32, aLength As Int32) As String
Parameters:
- StartIndex: Starting position of a substring.
- aLength: The number of characters to be copied.
ToByteArray mapped
Converts current string into a byte array with UTF-8 encoding.
method ToByteArray: array of Byte
Byte[] ToByteArray()
func ToByteArray() -> Byte...
Byte[] ToByteArray()
Function ToByteArray() As Byte()
method ToByteArray(aEncoding: Encoding): array of Byte
Byte[] ToByteArray(Encoding aEncoding)
func ToByteArray(_ aEncoding: Encoding) -> Byte...
Byte[] ToByteArray(Encoding aEncoding)
Function ToByteArray(aEncoding As Encoding) As Byte()
Parameters:
- aEncoding:
ToCharArray mapped
method ToCharArray: array of Char
Char[] ToCharArray()
func ToCharArray() -> Char...
Char[] ToCharArray()
Function ToCharArray() As Char()
ToLower mapped
Returns a copy of current string converted to lowercase.
method ToLower: not nullable String
String! ToLower()
func ToLower() -> String
String ToLower()
Function ToLower() As String
Returns a copy of current string converted to lowercase.
method ToLower(aLocale: Locale): not nullable String
String! ToLower(Locale aLocale)
func ToLower(_ aLocale: Locale) -> String
String ToLower(Locale aLocale)
Function ToLower(aLocale As Locale) As String
Parameters:
- aLocale:
ToLowerInvariant mapped
method ToLowerInvariant: not nullable String
String! ToLowerInvariant()
func ToLowerInvariant() -> String
String ToLowerInvariant()
Function ToLowerInvariant() As String
ToUpper mapped
Returns a copy of current string converted to uppercase.
method ToUpper: not nullable String
String! ToUpper()
func ToUpper() -> String
String ToUpper()
Function ToUpper() As String
Returns a copy of current string converted to uppercase.
method ToUpper(aLocale: Locale): not nullable String
String! ToUpper(Locale aLocale)
func ToUpper(_ aLocale: Locale) -> String
String ToUpper(Locale aLocale)
Function ToUpper(aLocale As Locale) As String
Parameters:
- aLocale:
ToUpperInvariant mapped
method ToUpperInvariant: not nullable String
String! ToUpperInvariant()
func ToUpperInvariant() -> String
String ToUpperInvariant()
Function ToUpperInvariant() As String
Trim mapped
Removes all leading and trailing white-space characters from the current string.
method Trim: not nullable String
String! Trim()
func Trim() -> String
String Trim()
Function Trim() As String
method Trim(TrimChars: array of Char): not nullable String
String! Trim(Char[] TrimChars)
func Trim(_ TrimChars: Char...) -> String
String Trim(Char[] TrimChars)
Function Trim(TrimChars As Char()) As String
Parameters:
- TrimChars:
TrimEnd mapped
method TrimEnd(TrimChars: array of Char): not nullable String
String! TrimEnd(Char[] TrimChars)
func TrimEnd(_ TrimChars: Char...) -> String
String TrimEnd(Char[] TrimChars)
Function TrimEnd(TrimChars As Char()) As String
Parameters:
- TrimChars:
TrimStart mapped
method TrimStart(TrimChars: array of Char): not nullable String
String! TrimStart(Char[] TrimChars)
func TrimStart(_ TrimChars: Char...) -> String
String TrimStart(Char[] TrimChars)
Function TrimStart(TrimChars As Char()) As String
Parameters:
- TrimChars:
Chars
Gets a character withing the string with specified index.
property Chars[aIndex: Int32]: Char read;
Char Chars[Int32 aIndex] { get; }
subscript Chars(_ aIndex: Int32) -> Char { get{} }
Char Chars[Int32 aIndex] { __get; }
ReadOnly Property Chars(aIndex As Int32) As Char
Length
property Length: Int32 read;
Int32 Length { get; }
var Length: Int32 { get{} }
Int32 Length { __get; }
ReadOnly Property Length() As Int32
CharacterIsWhiteSpace
Checks whether specified character is a whitespace.
class method CharacterIsWhiteSpace(Value: Char): Boolean
static Boolean CharacterIsWhiteSpace(Char Value)
static func CharacterIsWhiteSpace(_ Value: Char) -> Boolean
static Boolean CharacterIsWhiteSpace(Char Value)
Shared Function CharacterIsWhiteSpace(Value As Char) As Boolean
Parameters:
- Value: Character to check.
class method Equals(ValueA: String; ValueB: String): Boolean
static Boolean Equals(String ValueA, String ValueB)
static func Equals(_ ValueA: String, _ ValueB: String) -> Boolean
static Boolean Equals(String ValueA, String ValueB)
Shared Function Equals(ValueA As String, ValueB As String) As Boolean
Parameters:
- ValueA:
- ValueB:
class method EqualsIgnoringCase(ValueA: String; ValueB: String): Boolean
static Boolean EqualsIgnoringCase(String ValueA, String ValueB)
static func EqualsIgnoringCase(_ ValueA: String, _ ValueB: String) -> Boolean
static Boolean EqualsIgnoringCase(String ValueA, String ValueB)
Shared Function EqualsIgnoringCase(ValueA As String, ValueB As String) As Boolean
Parameters:
- ValueA:
- ValueB:
class method EqualsIgnoringCaseInvariant(ValueA: String; ValueB: String): Boolean
static Boolean EqualsIgnoringCaseInvariant(String ValueA, String ValueB)
static func EqualsIgnoringCaseInvariant(_ ValueA: String, _ ValueB: String) -> Boolean
static Boolean EqualsIgnoringCaseInvariant(String ValueA, String ValueB)
Shared Function EqualsIgnoringCaseInvariant(ValueA As String, ValueB As String) As Boolean
Parameters:
- ValueA:
- ValueB:
Format
Replaces the format item in a specified string with the string representation of a corresponding object in a specified array.
Each format item takes the following form and consists of the following components: {Index[,Alignment][:FormatSecifier]}
- Index - zero based index in the array.
- Alignment - optional, signed integer indicating the preferred formatted field width. If value is less than the length of the formatted string, alignment is ignored otherwise string is extended with space character either left or right, depending on a sign.
- FormatSpecifier - currently ignored.
Please note, currently string supports only basic formating and align, no data specific transformations will be applied.
String.Format("First {0} Third", 2); //results in "First 2 Third"
String.Format("{0,7}", "Text"); //results in " Text"
String.Format("{0:X4}", 255); //results in "255", format specifier is ignored.
class method Format(aFormat: String; params aParams: array of Object): not nullable String
static String! Format(String aFormat, params Object[] aParams)
static func Format(_ aFormat: String, _ aParams: Object...) -> String
static String Format(String aFormat, Object[]... aParams)
Shared Function Format(aFormat As String, ParamArray aParams As Object()) As String
Parameters:
- aFormat: Format of a new string.
- aParams: Array of objects to format.
IsNullOrEmpty
Checks whether specified string is nil
or contains no data.
class method IsNullOrEmpty(Value: String): Boolean
static Boolean IsNullOrEmpty(String Value)
static func IsNullOrEmpty(_ Value: String) -> Boolean
static Boolean IsNullOrEmpty(String Value)
Shared Function IsNullOrEmpty(Value As String) As Boolean
Parameters:
- Value: The string to check.
IsNullOrWhiteSpace
Checks whether specified string is nil
or contains only whit space characters.
class method IsNullOrWhiteSpace(Value: String): Boolean
static Boolean IsNullOrWhiteSpace(String Value)
static func IsNullOrWhiteSpace(_ Value: String) -> Boolean
static Boolean IsNullOrWhiteSpace(String Value)
Shared Function IsNullOrWhiteSpace(Value As String) As Boolean
Parameters:
- Value: The string to check.
Join
class method Join(Separator: String; Values: array of String): String
static String Join(String Separator, String[] Values)
static func Join(_ Separator: String, _ Values: String...) -> String
static String Join(String Separator, String[] Values)
Shared Function Join(Separator As String, Values As String()) As String
Parameters:
- Separator:
- Values:
Creates a new instance of the class with specified array.
constructor(Value: array of Byte; Encoding: Encoding)
String(Byte[] Value, Encoding Encoding)
init(_ Value: Byte..., _ Encoding: Encoding)
String(Byte[] Value, Encoding Encoding)
Sub New(Value As Byte(), Encoding As Encoding)
Parameters:
- Value: Array of byte
- Encoding:
constructor (array of Char)
Creates a new instance of the class with specified array.
constructor(Value: array of Char)
String(Char[] Value)
init(_ Value: Char...)
String(Char[] Value)
Sub New(Value As Char())
Parameters:
- Value: Array of char.
constructor(Value: array of Char; Offset: Int32; Count: Int32)
String(Char[] Value, Int32 Offset, Int32 Count)
init(_ Value: Char..., _ Offset: Int32, _ Count: Int32)
String(Char[] Value, Int32 Offset, Int32 Count)
Sub New(Value As Char(), Offset As Int32, Count As Int32)
Parameters:
- Value:
- Offset:
- Count:
constructor(aChar: Char; aCount: Int32)
String(Char aChar, Int32 aCount)
init(_ aChar: Char, _ aCount: Int32)
String(Char aChar, Int32 aCount)
Sub New(aChar As Char, aCount As Int32)
Parameters:
- aChar:
- aCount:
CompareTo mapped
Compares specified String object with the current string. The result is a negative integer if current string precedes the argument string. The result is a positive integer if current string follows the argument string. The result is zero if the strings are equal.
method CompareTo(Value: String): Int32
Int32 CompareTo(String Value)
func CompareTo(_ Value: String) -> Int32
Int32 CompareTo(String Value)
Function CompareTo(Value As String) As Int32
Parameters:
- Value: The string to compare.
CompareToIgnoreCase mapped
Compares specified String object with the current string, ignoring case differences. The result is a negative integer if current string precedes the argument string. The result is a positive integer if current string follows the argument string. The result is zero if the strings are equal.
method CompareToIgnoreCase(Value: String): Int32
Int32 CompareToIgnoreCase(String Value)
func CompareToIgnoreCase(_ Value: String) -> Int32
Int32 CompareToIgnoreCase(String Value)
Function CompareToIgnoreCase(Value As String) As Int32
Parameters:
- Value: The string to compare.
Contains mapped
Returns a value indicating whether a specified substring occurs within this string.
method Contains(Value: String): Boolean
Boolean Contains(String Value)
func Contains(_ Value: String) -> Boolean
Boolean Contains(String Value)
Function Contains(Value As String) As Boolean
Parameters:
- Value: The string to seek.
EndsWith mapped
Returns a value indicating whether current string ends with a specified string.
method EndsWith(Value: String; IgnoreCase: Boolean): Boolean
Boolean EndsWith(String Value, Boolean IgnoreCase)
func EndsWith(_ Value: String, _ IgnoreCase: Boolean) -> Boolean
Boolean EndsWith(String Value, Boolean IgnoreCase)
Function EndsWith(Value As String, IgnoreCase As Boolean) As Boolean
Parameters:
- Value: The string to seek.
- IgnoreCase:
Determines whether current string and another specified String object have the same value.
method Equals(Value: String): Boolean
Boolean Equals(String Value)
func Equals(_ Value: String) -> Boolean
Boolean Equals(String Value)
Function Equals(Value As String) As Boolean
Parameters:
- Value: The string to compare.
Determines whether current string and another specified String object have the same value, ignoring case differences..
method EqualsIgnoringCase(Value: String): Boolean
Boolean EqualsIgnoringCase(String Value)
func EqualsIgnoringCase(_ Value: String) -> Boolean
Boolean EqualsIgnoringCase(String Value)
Function EqualsIgnoringCase(Value As String) As Boolean
Parameters:
- Value: The string to compare.
method EqualsIgnoringCaseInvariant(Value: String): Boolean
Boolean EqualsIgnoringCaseInvariant(String Value)
func EqualsIgnoringCaseInvariant(_ Value: String) -> Boolean
Boolean EqualsIgnoringCaseInvariant(String Value)
Function EqualsIgnoringCaseInvariant(Value As String) As Boolean
Parameters:
- Value:
method IndexOf(Value: String; StartIndex: Int32): Int32
Int32 IndexOf(String Value, Int32 StartIndex)
func IndexOf(_ Value: String, _ StartIndex: Int32) -> Int32
Int32 IndexOf(String Value, Int32 StartIndex)
Function IndexOf(Value As String, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
method IndexOf(Value: Char; StartIndex: Int32): Int32
Int32 IndexOf(Char Value, Int32 StartIndex)
func IndexOf(_ Value: Char, _ StartIndex: Int32) -> Int32
Int32 IndexOf(Char Value, Int32 StartIndex)
Function IndexOf(Value As Char, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
method IndexOfAny(AnyOf: array of Char): Int32
Int32 IndexOfAny(Char[] AnyOf)
func IndexOfAny(_ AnyOf: Char...) -> Int32
Int32 IndexOfAny(Char[] AnyOf)
Function IndexOfAny(AnyOf As Char()) As Int32
Parameters:
- AnyOf:
method IndexOfAny(AnyOf: array of Char; StartIndex: Int32): Int32
Int32 IndexOfAny(Char[] AnyOf, Int32 StartIndex)
func IndexOfAny(_ AnyOf: Char..., _ StartIndex: Int32) -> Int32
Int32 IndexOfAny(Char[] AnyOf, Int32 StartIndex)
Function IndexOfAny(AnyOf As Char(), StartIndex As Int32) As Int32
Parameters:
- AnyOf:
- StartIndex:
Finds the zero-based index of the last occurrence of the specified string in the current string or -1
if it wasn't found.
method LastIndexOf(Value: String): Int32
Int32 LastIndexOf(String Value)
func LastIndexOf(_ Value: String) -> Int32
Int32 LastIndexOf(String Value)
Function LastIndexOf(Value As String) As Int32
Parameters:
- Value: The string to seek.
method LastIndexOf(Value: Char): Int32
Int32 LastIndexOf(Char Value)
func LastIndexOf(_ Value: Char) -> Int32
Int32 LastIndexOf(Char Value)
Function LastIndexOf(Value As Char) As Int32
Parameters:
- Value:
method LastIndexOf(Value: String; StartIndex: Int32): Int32
Int32 LastIndexOf(String Value, Int32 StartIndex)
func LastIndexOf(_ Value: String, _ StartIndex: Int32) -> Int32
Int32 LastIndexOf(String Value, Int32 StartIndex)
Function LastIndexOf(Value As String, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
method LastIndexOf(Value: Char; StartIndex: Int32): Int32
Int32 LastIndexOf(Char Value, Int32 StartIndex)
func LastIndexOf(_ Value: Char, _ StartIndex: Int32) -> Int32
Int32 LastIndexOf(Char Value, Int32 StartIndex)
Function LastIndexOf(Value As Char, StartIndex As Int32) As Int32
Parameters:
- Value:
- StartIndex:
PadEnd mapped
method PadEnd(TotalWidth: Int32; PaddingChar: Char): String
String PadEnd(Int32 TotalWidth, Char PaddingChar)
func PadEnd(_ TotalWidth: Int32, _ PaddingChar: Char) -> String
String PadEnd(Int32 TotalWidth, Char PaddingChar)
Function PadEnd(TotalWidth As Int32, PaddingChar As Char) As String
Parameters:
- TotalWidth:
- PaddingChar:
PadStart mapped
method PadStart(TotalWidth: Int32; PaddingChar: Char): String
String PadStart(Int32 TotalWidth, Char PaddingChar)
func PadStart(_ TotalWidth: Int32, _ PaddingChar: Char) -> String
String PadStart(Int32 TotalWidth, Char PaddingChar)
Function PadStart(TotalWidth As Int32, PaddingChar As Char) As String
Parameters:
- TotalWidth:
- PaddingChar:
Replace mapped
Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string.
method Replace(OldValue: String; NewValue: String): not nullable String
String! Replace(String OldValue, String NewValue)
func Replace(_ OldValue: String, _ NewValue: String) -> String
String Replace(String OldValue, String NewValue)
Function Replace(OldValue As String, NewValue As String) As String
Parameters:
- OldValue: The string to be replaced.
- NewValue: The string to replace with.
Split mapped
Returns a string array that contains the substrings in the current string that are delimited by specified separator.
method Split(Separator: String): array of String
String[] Split(String Separator)
func Split(_ Separator: String) -> String...
String[] Split(String Separator)
Function Split(Separator As String) As String()
Parameters:
- Separator: String that delimits the substrings in the current string.
StartsWith mapped
Returns a value indicating whether current string starts with a specified string.
method StartsWith(Value: String; IgnoreCase: Boolean): Boolean
Boolean StartsWith(String Value, Boolean IgnoreCase)
func StartsWith(_ Value: String, _ IgnoreCase: Boolean) -> Boolean
Boolean StartsWith(String Value, Boolean IgnoreCase)
Function StartsWith(Value As String, IgnoreCase As Boolean) As Boolean
Parameters:
- Value: The string to seek.
- IgnoreCase:
Retrieves a substring from current string. The substring starts at a specified position and continues to the end of the string.
method Substring(StartIndex: Int32): not nullable String
String! Substring(Int32 StartIndex)
func Substring(_ StartIndex: Int32) -> String
String Substring(Int32 StartIndex)
Function Substring(StartIndex As Int32) As String
Parameters:
- StartIndex: Starting position of a substring.
Retrieves a substring from current string. The substring starts at a specified position and has specified length.
method Substring(StartIndex: Int32; aLength: Int32): not nullable String
String! Substring(Int32 StartIndex, Int32 aLength)
func Substring(_ StartIndex: Int32, _ aLength: Int32) -> String
String Substring(Int32 StartIndex, Int32 aLength)
Function Substring(StartIndex As Int32, aLength As Int32) As String
Parameters:
- StartIndex: Starting position of a substring.
- aLength: The number of characters to be copied.
ToByteArray mapped
Converts current string into a byte array with UTF-8 encoding.
method ToByteArray: array of Byte
Byte[] ToByteArray()
func ToByteArray() -> Byte...
Byte[] ToByteArray()
Function ToByteArray() As Byte()
method ToByteArray(aEncoding: Encoding): array of Byte
Byte[] ToByteArray(Encoding aEncoding)
func ToByteArray(_ aEncoding: Encoding) -> Byte...
Byte[] ToByteArray(Encoding aEncoding)
Function ToByteArray(aEncoding As Encoding) As Byte()
Parameters:
- aEncoding:
ToCharArray mapped
method ToCharArray: array of Char
Char[] ToCharArray()
func ToCharArray() -> Char...
Char[] ToCharArray()
Function ToCharArray() As Char()
ToLower mapped
Returns a copy of current string converted to lowercase.
method ToLower: not nullable String
String! ToLower()
func ToLower() -> String
String ToLower()
Function ToLower() As String
Returns a copy of current string converted to lowercase.
method ToLower(aLocale: Locale): not nullable String
String! ToLower(Locale aLocale)
func ToLower(_ aLocale: Locale) -> String
String ToLower(Locale aLocale)
Function ToLower(aLocale As Locale) As String
Parameters:
- aLocale:
ToLowerInvariant mapped
method ToLowerInvariant: not nullable String
String! ToLowerInvariant()
func ToLowerInvariant() -> String
String ToLowerInvariant()
Function ToLowerInvariant() As String
ToUpper mapped
Returns a copy of current string converted to uppercase.
method ToUpper: not nullable String
String! ToUpper()
func ToUpper() -> String
String ToUpper()
Function ToUpper() As String
Returns a copy of current string converted to uppercase.
method ToUpper(aLocale: Locale): not nullable String
String! ToUpper(Locale aLocale)
func ToUpper(_ aLocale: Locale) -> String
String ToUpper(Locale aLocale)
Function ToUpper(aLocale As Locale) As String
Parameters:
- aLocale:
ToUpperInvariant mapped
method ToUpperInvariant: not nullable String
String! ToUpperInvariant()
func ToUpperInvariant() -> String
String ToUpperInvariant()
Function ToUpperInvariant() As String
Trim mapped
Removes all leading and trailing white-space characters from the current string.
method Trim: not nullable String
String! Trim()
func Trim() -> String
String Trim()
Function Trim() As String
method Trim(TrimChars: array of Char): not nullable String
String! Trim(Char[] TrimChars)
func Trim(_ TrimChars: Char...) -> String
String Trim(Char[] TrimChars)
Function Trim(TrimChars As Char()) As String
Parameters:
- TrimChars:
TrimEnd mapped
method TrimEnd(TrimChars: array of Char): not nullable String
String! TrimEnd(Char[] TrimChars)
func TrimEnd(_ TrimChars: Char...) -> String
String TrimEnd(Char[] TrimChars)
Function TrimEnd(TrimChars As Char()) As String
Parameters:
- TrimChars:
TrimStart mapped
method TrimStart(TrimChars: array of Char): not nullable String
String! TrimStart(Char[] TrimChars)
func TrimStart(_ TrimChars: Char...) -> String
String TrimStart(Char[] TrimChars)
Function TrimStart(TrimChars As Char()) As String
Parameters:
- TrimChars: