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

 

constructor (array of Byte, Encoding)

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)

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)

Parameters:

  • Value: Array of char.

constructor (array of Char, Int32, Int32)

 

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)

Parameters:

  • Value:
  • Offset:
  • Count:

constructor (Char, Int32)

 

constructor(aChar: Char; aCount: Int32)

 

String(Char aChar, Int32 aCount)

 

init(_ aChar: Char, _ aCount: Int32)

 

String(Char aChar, Int32 aCount)

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)

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; }

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)

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)

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)

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)

Parameters:

  • Value: The string to seek.
  • IgnoreCase:

Equals (String, String): Boolean

 

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)

Parameters:

  • ValueA:
  • ValueB:

Equals (String): Boolean  mapped

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)

Parameters:

  • Value: The string to compare.

EqualsIgnoringCase (String, String): Boolean

 

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)

Parameters:

  • ValueA:
  • ValueB:

EqualsIgnoringCase (String): Boolean  mapped

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)

Parameters:

  • Value: The string to compare.

EqualsIgnoringCaseInvariant (String, String): Boolean

 

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)

Parameters:

  • ValueA:
  • ValueB:

EqualsIgnoringCaseInvariant (String): Boolean  mapped

 

method EqualsIgnoringCaseInvariant(Value: String): Boolean

 

Boolean EqualsIgnoringCaseInvariant(String Value)

 

func EqualsIgnoringCaseInvariant(_ Value: String) -> Boolean

 

Boolean EqualsIgnoringCaseInvariant(String Value)

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)

Parameters:

  • aFormat: Format of a new string.
  • aParams: Array of objects to format.

IndexOf (String, Int32): Int32  mapped

 

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)

Parameters:

  • Value:
  • StartIndex:

IndexOf (Char, Int32): Int32  mapped

 

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)

Parameters:

  • Value:
  • StartIndex:

IndexOfAny (array of Char): Int32  mapped

 

method IndexOfAny(AnyOf: array of Char): Int32

 

Int32 IndexOfAny(Char[] AnyOf)

 

func IndexOfAny(_ AnyOf: Char...) -> Int32

 

Int32 IndexOfAny(Char[] AnyOf)

Parameters:

  • AnyOf:

IndexOfAny (array of Char, Int32): Int32  mapped

 

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)

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)

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)

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)

Parameters:

  • Separator:
  • Values:

LastIndexOf (String): Int32  mapped

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)

Parameters:

  • Value: The string to seek.

LastIndexOf (Char): Int32  mapped

 

method LastIndexOf(Value: Char): Int32

 

Int32 LastIndexOf(Char Value)

 

func LastIndexOf(_ Value: Char) -> Int32

 

Int32 LastIndexOf(Char Value)

Parameters:

  • Value:

LastIndexOf (String, Int32): Int32  mapped

 

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)

Parameters:

  • Value:
  • StartIndex:

LastIndexOf (Char, Int32): Int32  mapped

 

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)

Parameters:

  • Value:
  • StartIndex:

Length

 

property Length: Int32 read;

 

Int32 Length { get; }

 

var Length: Int32 { get{} }

 

Int32 Length { __get; }

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)

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)

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)

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)

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)

Parameters:

  • Value: The string to seek.
  • IgnoreCase:

Substring (Int32): not nullable String  mapped

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)

Parameters:

  • StartIndex: Starting position of a substring.

Substring (Int32, Int32): not nullable String  mapped

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)

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()

ToByteArray (Encoding): array of Byte  mapped

 

method ToByteArray(aEncoding: Encoding): array of Byte

 

Byte[] ToByteArray(Encoding aEncoding)

 

func ToByteArray(_ aEncoding: Encoding) -> Byte...

 

Byte[] ToByteArray(Encoding aEncoding)

Parameters:

  • aEncoding:

ToCharArray  mapped

 

method ToCharArray: array of Char

 

Char[] ToCharArray()

 

func ToCharArray() -> Char...

 

Char[] ToCharArray()

ToLower  mapped

Returns a copy of current string converted to lowercase.

 

method ToLower: not nullable String

 

String! ToLower()

 

func ToLower() -> String

 

String! ToLower()

ToLower (Locale): not nullable String  mapped

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)

Parameters:

  • aLocale:

ToLowerInvariant  mapped

 

method ToLowerInvariant: not nullable String

 

String! ToLowerInvariant()

 

func ToLowerInvariant() -> String

 

String! ToLowerInvariant()

ToUpper  mapped

Returns a copy of current string converted to uppercase.

 

method ToUpper: not nullable String

 

String! ToUpper()

 

func ToUpper() -> String

 

String! ToUpper()

ToUpper (Locale): not nullable String  mapped

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)

Parameters:

  • aLocale:

ToUpperInvariant  mapped

 

method ToUpperInvariant: not nullable String

 

String! ToUpperInvariant()

 

func ToUpperInvariant() -> String

 

String! ToUpperInvariant()

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()

Trim (array of Char): not nullable String  mapped

 

method Trim(TrimChars: array of Char): not nullable String

 

String! Trim(Char[] TrimChars)

 

func Trim(_ TrimChars: Char...) -> String

 

String! Trim(Char[] TrimChars)

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)

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)

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; }

Length

 

property Length: Int32 read;

 

Int32 Length { get; }

 

var Length: Int32 { get{} }

 

Int32 Length { __get; }

 

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)

Parameters:

  • Value: Character to check.

Equals (String, String): Boolean

 

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)

Parameters:

  • ValueA:
  • ValueB:

EqualsIgnoringCase (String, String): Boolean

 

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)

Parameters:

  • ValueA:
  • ValueB:

EqualsIgnoringCaseInvariant (String, String): Boolean

 

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)

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)

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)

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)

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)

Parameters:

  • Separator:
  • Values:

 

constructor (array of Byte, Encoding)

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)

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)

Parameters:

  • Value: Array of char.

constructor (array of Char, Int32, Int32)

 

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)

Parameters:

  • Value:
  • Offset:
  • Count:

constructor (Char, Int32)

 

constructor(aChar: Char; aCount: Int32)

 

String(Char aChar, Int32 aCount)

 

init(_ aChar: Char, _ aCount: Int32)

 

String(Char aChar, Int32 aCount)

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)

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)

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)

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)

Parameters:

  • Value: The string to seek.
  • IgnoreCase:

Equals (String): Boolean  mapped

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)

Parameters:

  • Value: The string to compare.

EqualsIgnoringCase (String): Boolean  mapped

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)

Parameters:

  • Value: The string to compare.

EqualsIgnoringCaseInvariant (String): Boolean  mapped

 

method EqualsIgnoringCaseInvariant(Value: String): Boolean

 

Boolean EqualsIgnoringCaseInvariant(String Value)

 

func EqualsIgnoringCaseInvariant(_ Value: String) -> Boolean

 

Boolean EqualsIgnoringCaseInvariant(String Value)

Parameters:

  • Value:

IndexOf (String, Int32): Int32  mapped

 

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)

Parameters:

  • Value:
  • StartIndex:

IndexOf (Char, Int32): Int32  mapped

 

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)

Parameters:

  • Value:
  • StartIndex:

IndexOfAny (array of Char): Int32  mapped

 

method IndexOfAny(AnyOf: array of Char): Int32

 

Int32 IndexOfAny(Char[] AnyOf)

 

func IndexOfAny(_ AnyOf: Char...) -> Int32

 

Int32 IndexOfAny(Char[] AnyOf)

Parameters:

  • AnyOf:

IndexOfAny (array of Char, Int32): Int32  mapped

 

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)

Parameters:

  • AnyOf:
  • StartIndex:

LastIndexOf (String): Int32  mapped

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)

Parameters:

  • Value: The string to seek.

LastIndexOf (Char): Int32  mapped

 

method LastIndexOf(Value: Char): Int32

 

Int32 LastIndexOf(Char Value)

 

func LastIndexOf(_ Value: Char) -> Int32

 

Int32 LastIndexOf(Char Value)

Parameters:

  • Value:

LastIndexOf (String, Int32): Int32  mapped

 

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)

Parameters:

  • Value:
  • StartIndex:

LastIndexOf (Char, Int32): Int32  mapped

 

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)

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)

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)

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)

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)

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)

Parameters:

  • Value: The string to seek.
  • IgnoreCase:

Substring (Int32): not nullable String  mapped

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)

Parameters:

  • StartIndex: Starting position of a substring.

Substring (Int32, Int32): not nullable String  mapped

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)

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()

ToByteArray (Encoding): array of Byte  mapped

 

method ToByteArray(aEncoding: Encoding): array of Byte

 

Byte[] ToByteArray(Encoding aEncoding)

 

func ToByteArray(_ aEncoding: Encoding) -> Byte...

 

Byte[] ToByteArray(Encoding aEncoding)

Parameters:

  • aEncoding:

ToCharArray  mapped

 

method ToCharArray: array of Char

 

Char[] ToCharArray()

 

func ToCharArray() -> Char...

 

Char[] ToCharArray()

ToLower  mapped

Returns a copy of current string converted to lowercase.

 

method ToLower: not nullable String

 

String! ToLower()

 

func ToLower() -> String

 

String! ToLower()

ToLower (Locale): not nullable String  mapped

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)

Parameters:

  • aLocale:

ToLowerInvariant  mapped

 

method ToLowerInvariant: not nullable String

 

String! ToLowerInvariant()

 

func ToLowerInvariant() -> String

 

String! ToLowerInvariant()

ToUpper  mapped

Returns a copy of current string converted to uppercase.

 

method ToUpper: not nullable String

 

String! ToUpper()

 

func ToUpper() -> String

 

String! ToUpper()

ToUpper (Locale): not nullable String  mapped

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)

Parameters:

  • aLocale:

ToUpperInvariant  mapped

 

method ToUpperInvariant: not nullable String

 

String! ToUpperInvariant()

 

func ToUpperInvariant() -> String

 

String! ToUpperInvariant()

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()

Trim (array of Char): not nullable String  mapped

 

method Trim(TrimChars: array of Char): not nullable String

 

String! Trim(Char[] TrimChars)

 

func Trim(_ TrimChars: Char...) -> String

 

String! Trim(Char[] TrimChars)

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)

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)

Parameters:

  • TrimChars: