SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND


Platform
Class String
Implemented in:
Platform.String.h

class String

A string represents a sequence of Char type characters. Strings are mutable objects and provide methods for examining and modifying individual characters of the sequence, for comparing strings, for searching strings, for extracting substrings, for transforming strings to uppercase, lowercase or titlecase and for parsing and converting text within strings to numerical values.

When Platform_DEF_Unicode_Char is defined the String class fully supports Unicode, otherwise the String class supports the basic latin subset of Unicode.

The String class provides safe semantics. This means that the input parameters of String's metods are checked for validity and corrected to safe values whenever needed. The contents of a string are presented to the user as a sequence of characters infinitely padded with zeroes to the left and to the right. For instance:
    String str("abcde");

    str.charAt(0) == appText('a');    // the first char at index 0
    str.charAt(4) == appText('e');    // the last char at index 4

    str.charAt(-100) == 0;    // access at any index before the first char
    str.charAt(100) == 0;    // access at any index after the last char

    // substring witin range 0 thru length() yields string
    str.substring(0, str.length()) == appText("abcde");

    // substring with invalid range yields an empty string
    str.substring(-100, 100) == appText("");
Use String::concatenate methods to efficiently concatenate strings. Another way to concatenate strings is by using the string concatenation operator+.

See Also:
Platform_DEF_Unicode_Char
Char, LatinChar, UniChar
Platform::Chr, Platform::Str

Inner Compounds, Typedefs, and Enumscollapse
struct CustomDelimiter
          Custom string delimiter function object.
class LatinCharBuffer
          A LatinCharBuffer allows to convert a String into a null terminated sequence of LatinChar characters.
struct NewLineDelimiter
          New-line string delimiter function object.
struct Position
          Line and column position info.
class Tokenizer
          A string tokenizer allows to break a string into tokens based on a set of delimeters (the characters that separate tokens), or a delimiter function object of type String::Delimiter.
struct WhiteSpaceDelimiter
          White-space string delimiter function object.
typedef Delimiter
          A character delimiter function object type.

Constructor Summarycollapse
String()
          Creates an empty string.
String(const String& string)
          Creates a copy of the specified string.
String(Bool value)
          Creates a new string representing the specified boolean value.
String(const LatinChar* string)
          Creates a new string representing the given native C string.
String(const LatinChar* string, Int length)
          Creates a new string representing the given native C string.
String(const String& string, Int offset, Int length)
          Creates a new string by extracting a substring from the given string.
String(const UniChar* string)
          Creates a new string representing the given native C string.
String(const UniChar* string, Int length)
          Creates a new string representing the given native C string.
String(Double value)
          Creates a new string representing the specified numerical value.
String(Float value)
          Creates a new string representing the specified numerical value.
String(Int value)
          Creates a new string representing the specified numerical value.
String(LatinChar value)
          Creates a new string containing the specified character.
String(LatinChar value, Int count)
          Creates a new string filled with the specified character replicated count number of times.
String(Long value)
          Creates a new string representing the specified numerical value.
String(Short value)
          Creates a new string representing the specified numerical value.
String(Small value)
          Creates a new string representing the specified numerical value.
String(UInt value)
          Creates a new string representing the specified numerical value.
String(ULong value)
          Creates a new string representing the specified numerical value.
String(UniChar value)
          Creates a new string containing the specified character.
String(UniChar value, Int count)
          Creates a new string filled with the specified character replicated count number of times.
String(UShort value)
          Creates a new string representing the specified numerical value.
String(USmall value)
          Creates a new string representing the specified numerical value.
~String()
          Destroys this string.

Method Summarycollapse
String& append(const Char* string)
          Appends the characters in the given string at the end of this string.
String& append(const String& string)
          Appends the characters in the given string at the end of this string.
String& append(LatinChar c)
          Appends the specified character at the end of this string.
String& append(UniChar c)
          Appends the specified character at the end of this string.
Char charAt(Int index) const
          Retrieves a character at the specified index in this string.
Int compareTo(const String& string) const
          DOCTODO.
Int compareToIgnoreCase(const String& string) const
          DOCTODO.
static String concatenate(Char a, Char b)
          Efficiently concatenates the input strings.
static String concatenate(Char a, Char b, Char c)
          Efficiently concatenates the input strings.
static String concatenate(Char a, const String& b, Char c)
          Efficiently concatenates the input strings.
static String concatenate(const LatinChar* a, const String& b)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, Char b, const String& c)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const LatinChar* b)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const String& b)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const String& b, const String& c)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const String& b, const String& c, const String& d)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e, const String& f)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e, const String& f, const String& g)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e, const String& f, const String& g, const String& h)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, const UniChar* b)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, LatinChar b)
          Efficiently concatenates the input strings.
static String concatenate(const String& a, UniChar b)
          Efficiently concatenates the input strings.
static String concatenate(const UniChar* a, const String& b)
          Efficiently concatenates the input strings.
static String concatenate(LatinChar a, const String& b)
          Efficiently concatenates the input strings.
static String concatenate(UniChar a, const String& b)
          Efficiently concatenates the input strings.
Bool contains(Char c) const
          Tests whether a string contains the specified character.
Bool contains(const Char* string) const
          Tests whether a string contains the specified string.
Bool contains(const String& string) const
          Tests whether a string contains the specified string.
UInt deepSize() const
          DOCTODO.
Void empty()
          Sets the size of a string to zero.
Bool endsWith(Char c) const
          DOCTODO.
Bool endsWith(const Char* string) const
          DOCTODO.
Bool endsWith(const String& string) const
          DOCTODO.
String& ensureCapacity(Int capacity)
          Ensures that a string can hold the specified number of characters without internal storage reallocation.
Bool equals(Char c) const
          DOCTODO.
Bool equals(const Char* string) const
          DOCTODO.
Bool equals(const String& string) const
          DOCTODO.
Bool equalsIgnoreCase(Char c) const
          DOCTODO.
Bool equalsIgnoreCase(const Char* string) const
          DOCTODO.
Bool equalsIgnoreCase(const String& string) const
          DOCTODO.
Void exchangeWith(String& string)
          DOCTODO.
String& fillRange(Int fromIndex, Int toIndex, Char filling = appText(' '))
          DOCTODO.
String& format(const Char* formatting, ...)
          DOCTODO.
String& formatv(const Char* formatting, va_list arguments)
          DOCTODO.
UInt hashCode() const
          DOCTODO.
UInt hashCodeIgnoreCase() const
          DOCTODO.
Int indexOf(Char c) const
          Searches this string for the first occurance of the specified character.
Int indexOf(Char c, Int fromIndex) const
          Searches this string for the first occurance of the specified character, starting at the specified index.
Int indexOf(const Char* string) const
          Searches this string for the first occurance of the specified string.
Int indexOf(const Char* string, Int fromIndex) const
          Searches this string for the first occurance of the specified string, starting at the specified index.
Int indexOf(const String& string) const
          Searches this string for the first occurance of the specified string.
Int indexOf(const String& string, Int fromIndex) const
          Searches this string for the first occurance of the specified string, starting at the specified index.
String& insertAt(Int index, Char c)
          DOCTODO.
String& insertAt(Int index, const Char* string)
          DOCTODO.
String& insertAt(Int index, const String& string)
          DOCTODO.
Bool isEmpty() const
          DOCTODO.
Bool isNewLine(Int index) const
          DOCTODO.
Bool isValidIndex(Int index) const
          DOCTODO.
Int lastIndexOf(Char c) const
          Searches this string for the last occurance of the specified character.
Int lastIndexOf(Char c, Int fromIndex) const
          Searches this string for the last occurance of the specified character, starting at the specified index (the search is performed backwards, that is towards the begining of this string).
Int lastIndexOf(const Char* string) const
          Searches this string for the last occurance of the specified string.
Int lastIndexOf(const Char* string, Int fromIndex) const
          Searches this string for the last occurance of the specified string, starting at the specified index (the search is performed backwards, that is towards the begining of this string).
Int lastIndexOf(const String& string) const
          Searches this string for the last occurance of the specified string.
Int lastIndexOf(const String& string, Int fromIndex) const
          Searches this string for the last occurance of the specified string, starting at the specified index (the search is performed backwards, that is towards the begining of this string).
Int length() const
          Returns the number of characters in the string.
Bool operator!=(Char c) const
          DOCTODO.
Bool operator!=(const Char* string) const
          DOCTODO.
const Char* operator+() const
          Retrieves the pointer to the character sequence of this string.
String& operator+=(const Char* string)
          Appends the characters in the given string at the end of this string.
String& operator+=(const String& string)
          Appends the characters in the given string at the end of this string.
String& operator+=(LatinChar c)
          Appends the specified character at the end of this string.
String& operator+=(UniChar c)
          Appends the specified character at the end of this string.
String& operator=(Char c)
          DOCTODO.
String& operator=(const Char* string)
          DOCTODO.
String& operator=(const String& string)
          DOCTODO.
Bool operator==(Char c) const
          DOCTODO.
Bool operator==(const Char* string) const
          DOCTODO.
Char& operator[](Int index)
          DOCTODO.
const Char& operator[](Int index) const
          DOCTODO.
String& padLeft(Int length, Char filling = appText(' '))
          DOCTODO.
String& padRight(Int length, Char filling = appText(' '))
          DOCTODO.
Position position(Int fromIndex, Int toIndex) const
          Computes the line and column position within a string.
Bool regionEquals(const Char* string, Int fromIndex) const
          DOCTODO.
Bool regionEquals(const Char c, Int fromIndex) const
          DOCTODO.
Bool regionEquals(const String& string, Int fromIndex) const
          DOCTODO.
Bool regionEqualsIgnoreCase(const Char* string, Int fromIndex) const
          DOCTODO.
Bool regionEqualsIgnoreCase(const Char c, Int fromIndex) const
          DOCTODO.
Bool regionEqualsIgnoreCase(const String& string, Int fromIndex) const
          DOCTODO.
Bool regionMatches(const String& pattern, Int fromIndex = 0) const
          DOCTODO.
Bool regionMatchesIgnoreCase(const String& pattern, Int fromIndex = 0) const
          DOCTODO.
String& removeAt(Int index)
          DOCTODO.
String& removeRange(Int fromIndex, Int toIndex)
          DOCTODO.
String& replace(Char oldChar, Char newChar)
          DOCTODO.
String& replace(const String& oldString, const String& newString)
          DOCTODO.
String& reverse()
          DOCTODO.
Void setCharAt(Int index, Char c)
          Sets a character at the specified index in this string.
Int skipNewLine(Int fromIndex = 0) const
          Skips the NewLine characters starting at the specified index.
Int skipToNewLine(Int fromIndex = 0) const
          Skips until the first NewLine character starting at the specified index.
Int skipToWhitespace(Int fromIndex = 0) const
          Skips until the first Whitespace character starting at the specified index.
Int skipWhitespace(Int fromIndex = 0) const
          Skips the Whitespace characters starting at the specified index.
Containers::Array<String> split(Int fromIndex = 0, const Delimiter& delimeter = WhiteSpaceDelimiter()) const
          DOCTODO.
Bool startsWith(Char c) const
          DOCTODO.
Bool startsWith(const Char* string) const
          DOCTODO.
Bool startsWith(const String& string) const
          DOCTODO.
String substring(Int fromIndex) const
          Returns a new string that is a substring of this string.
String substring(Int fromIndex, Int toIndex) const
          Returns a new string that is a substring of this string.
Bool toBool(Int fromIndex = 0) const
          Attempts to parse a string and convert the result into a boolean number.
Bool toBool(Int fromIndex, Int& parsedLength) const
          Attempts to parse a string and convert the result into a boolean number.
Double toDouble(Int fromIndex = 0) const
          Attempts to parse a string and convert the result into a floating-point number.
Double toDouble(Int fromIndex, Int& parsedLength) const
          Attempts to parse a string and convert the result into a floating-point number.
Float toFloat(Int fromIndex = 0) const
          Attempts to parse a string and convert the result into a floating-point number.
Float toFloat(Int fromIndex, Int& parsedLength) const
          Attempts to parse a string and convert the result into a floating-point number.
Int toInt(Int fromIndex = 0) const
          Attempts to parse a string and convert the result into an integer number.
Int toInt(Int fromIndex, Int& parsedLength) const
          Attempts to parse a string and convert the result into an integer number.
Long toLong(Int fromIndex = 0) const
          Attempts to parse a string and convert the result into an integer number.
Long toLong(Int fromIndex, Int& parsedLength) const
          Attempts to parse a string and convert the result into an integer number.
String& toLowerCase()
          Converts the characters of this string to lower case.
String toString() const
          Returns a copy of a string.
UInt toUInt(Int fromIndex = 0) const
          Attempts to parse a string and convert the result into an integer number.
UInt toUInt(Int fromIndex, Int& parsedLength) const
          Attempts to parse a string and convert the result into an integer number.
ULong toULong(Int fromIndex = 0) const
          Attempts to parse a string and convert the result into an integer number.
ULong toULong(Int fromIndex, Int& parsedLength) const
          Attempts to parse a string and convert the result into an integer number.
String& toUpperCase()
          Converts the characters of this string to upper case.
String toXml() const
          Returns an XML representation of a string.
String& trim(Char c)
          DOCTODO.
String& trimCapacity()
          Attempts to reduce the internal storage used for holding the character sequence to the actual size of the string.
String& trimLeft(Char c)
          DOCTODO.
String& trimRight(Char c)
          DOCTODO.
String& trimWhitespace()
          DOCTODO.
String& trimWhitespaceLeft()
          DOCTODO.
String& trimWhitespaceRight()
          DOCTODO.
Char* value()
          Retrieves the pointer to the character sequence of this string.
const Char* value() const
          Retrieves the pointer to the character sequence of this string.

Friend Summarycollapse
friend Io::ISerializer& operator<<(Io::ISerializer& serializer, const String& string)
          Serializes the state of a String object.
friend Io::IDeserializer& operator>>(Io::IDeserializer& deserializer, String& string)
          Deserializes the state of a String object.

 

Constructor Detail

String[nothrow, inline]

String()

Creates an empty string.


String[nothrow, inline]

String(const String& string)

Creates a copy of the specified string.

Parameters:
string - a string

String[explicit, nothrow, inline]

String(Bool value)

Creates a new string representing the specified boolean value.

Parameters:
value - a boolean number to convert to string

String[nothrow, inline]

String(const LatinChar* string)

Creates a new string representing the given native C string.

Parameters:
string - a string

String[nothrow, inline]

String(const LatinChar* string, Int length)

Creates a new string representing the given native C string. The length parameter specifies the maximum length of the created string object.

Parameters:
string - a string
length - the maximum number of characters to parse

String[nothrow, inline]

String(const String& string, Int offset, Int length)

Creates a new string by extracting a substring from the given string.

Parameters:
string - a string
offset - the index to the first character
length - the maximum number of characters to parse

String[nothrow, inline]

String(const UniChar* string)

Creates a new string representing the given native C string.

Parameters:
string - a string

String[nothrow, inline]

String(const UniChar* string, Int length)

Creates a new string representing the given native C string. The length parameter specifies the maximum length of the created string object.

Parameters:
string - a string
length - the maximum number of characters to parse

String[explicit, nothrow, inline]

String(Double value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[explicit, nothrow, inline]

String(Float value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[explicit, nothrow, inline]

String(Int value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[nothrow, inline]

String(LatinChar value)

Creates a new string containing the specified character.

Parameters:
value - a character

String[nothrow, inline]

String(LatinChar value, Int count)

Creates a new string filled with the specified character replicated count number of times.

Parameters:
value - a character
count - the number of times to replicate the character

String[explicit, nothrow, inline]

String(Long value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[explicit, nothrow, inline]

String(Short value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[explicit, nothrow, inline]

String(Small value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[explicit, nothrow, inline]

String(UInt value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[explicit, nothrow, inline]

String(ULong value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[nothrow, inline]

String(UniChar value)

Creates a new string containing the specified character.

Parameters:
value - a character

String[nothrow, inline]

String(UniChar value, Int count)

Creates a new string filled with the specified character replicated count number of times.

Parameters:
value - a character
count - the number of times to replicate the character

String[explicit, nothrow, inline]

String(UShort value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

String[explicit, nothrow, inline]

String(USmall value)

Creates a new string representing the specified numerical value.

Parameters:
value - a number to convert to string

~String[nothrow, inline]

~String()

Destroys this string.

 

Method Detail

append[nothrow, inline]

String& append(const Char* string)

Appends the characters in the given string at the end of this string.

Parameters:
string - a string to append at the end of this string
Returns:
a reference to this string

append[nothrow, inline]

String& append(const String& string)

Appends the characters in the given string at the end of this string.

Parameters:
string - a string to append at the end of this string
Returns:
a reference to this string

append[nothrow, inline]

String& append(LatinChar c)

Appends the specified character at the end of this string.

Parameters:
c - a character to append at the end of this string
Returns:
a reference to this string

append[nothrow, inline]

String& append(UniChar c)

Appends the specified character at the end of this string.

Parameters:
c - a character to append at the end of this string
Returns:
a reference to this string

charAt[nothrow, inline]

Char charAt(Int index) const

Retrieves a character at the specified index in this string.

Parameters:
index - an index to get character at
Returns:
a character at the specified index in this string, or 0 if index is out of bounds (i.e. isValidIndex(index) == False)

compareTo[nothrow, inline]

Int compareTo(const String& string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

compareToIgnoreCase[nothrow, inline]

Int compareToIgnoreCase(const String& string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

concatenate[nothrow, inline]

static String concatenate(Char a, Char b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(Char a, Char b, Char c)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(Char a, const String& b, Char c)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const LatinChar* a, const String& b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, Char b, const String& c)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const LatinChar* b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const String& b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const String& b, const String& c)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const String& b, const String& c, const String& d)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e, const String& f)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e, const String& f, const String& g)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const String& b, const String& c, const String& d, const String& e, const String& f, const String& g, const String& h)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, const UniChar* b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, LatinChar b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const String& a, UniChar b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(const UniChar* a, const String& b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(LatinChar a, const String& b)

Efficiently concatenates the input strings.


concatenate[nothrow, inline]

static String concatenate(UniChar a, const String& b)

Efficiently concatenates the input strings.


contains[nothrow, inline]

Bool contains(Char c) const

Tests whether a string contains the specified character.

Parameters:
c - character to search for
Returns:
True if the specified character is found, False otherwise

contains[nothrow, inline]

Bool contains(const Char* string) const

Tests whether a string contains the specified string.

Parameters:
string - string to search for
Returns:
True if the specified string is found, False otherwise

contains[nothrow, inline]

Bool contains(const String& string) const

Tests whether a string contains the specified string.

Parameters:
string - string to search for
Returns:
True if the specified string is found, False otherwise

deepSize[nothrow, inline]

UInt deepSize() const

DOCTODO.

Returns:
DOCTODO

empty[nothrow, inline]

Void empty()

Sets the size of a string to zero.


endsWith[nothrow]

Bool endsWith(Char c) const

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

endsWith[nothrow]

Bool endsWith(const Char* string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

endsWith[nothrow]

Bool endsWith(const String& string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

ensureCapacity[nothrow, inline]

String& ensureCapacity(Int capacity)

Ensures that a string can hold the specified number of characters without internal storage reallocation.

Parameters:
capacity - the minimum desired capacity
Returns:
a reference to this string

equals[nothrow]

Bool equals(Char c) const

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

equals[nothrow]

Bool equals(const Char* string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

equals[nothrow]

Bool equals(const String& string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

equalsIgnoreCase[nothrow]

Bool equalsIgnoreCase(Char c) const

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

equalsIgnoreCase[nothrow]

Bool equalsIgnoreCase(const Char* string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

equalsIgnoreCase[nothrow]

Bool equalsIgnoreCase(const String& string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

exchangeWith[nothrow, inline]

Void exchangeWith(String& string)

DOCTODO.

Parameters:
string - DOCTODO

fillRange[nothrow]

String& fillRange(Int fromIndex, Int toIndex, Char filling = appText(' '))

DOCTODO.

Parameters:
fromIndex - DOCTODO
toIndex - DOCTODO
filling - DOCTODO
Returns:
DOCTODO

format[nothrow]

String& format(const Char* formatting, ...)

DOCTODO.

Parameters:
formatting - DOCTODO
... - DOCTODO
Returns:
DOCTODO

formatv[nothrow]

String& formatv(const Char* formatting, va_list arguments)

DOCTODO.

Parameters:
formatting - DOCTODO
arguments - DOCTODO
Returns:
DOCTODO

hashCode[nothrow, inline]

UInt hashCode() const

DOCTODO.

Returns:
DOCTODO

hashCodeIgnoreCase[nothrow, inline]

UInt hashCodeIgnoreCase() const

DOCTODO.

Returns:
DOCTODO

indexOf[nothrow]

Int indexOf(Char c) const

Searches this string for the first occurance of the specified character.

Parameters:
c - character to search for
Returns:
the index of the first occurrence of the specified character in this string, or -1 if not found

indexOf[nothrow]

Int indexOf(Char c, Int fromIndex) const

Searches this string for the first occurance of the specified character, starting at the specified index.

Parameters:
c - character to search for
fromIndex - starting index within this string
Returns:
the index of the first occurrence of the specified character in this string, such that fromIndex <= index, or -1 if not found or fromIndex is out of bounds (i.e. isValidIndex(fromIndex) == False)

indexOf[nothrow]

Int indexOf(const Char* string) const

Searches this string for the first occurance of the specified string.

Parameters:
string - string to search for
Returns:
the index of the first occurrence of the specified string in this string, or -1 if not found

indexOf[nothrow]

Int indexOf(const Char* string, Int fromIndex) const

Searches this string for the first occurance of the specified string, starting at the specified index.

Parameters:
string - string to search for
fromIndex - starting index within this string
Returns:
the index of the first occurrence of the specified string in this string, such that fromIndex <= index, or -1 if not found or fromIndex is out of bounds (i.e. isValidIndex(fromIndex) == False)

indexOf[nothrow]

Int indexOf(const String& string) const

Searches this string for the first occurance of the specified string.

Parameters:
string - string to search for
Returns:
the index of the first occurrence of the specified string in this string, or -1 if not found

indexOf[nothrow]

Int indexOf(const String& string, Int fromIndex) const

Searches this string for the first occurance of the specified string, starting at the specified index.

Parameters:
string - string to search for
fromIndex - starting index within this string
Returns:
the index of the first occurrence of the specified string in this string, such that fromIndex <= index, or -1 if not found or fromIndex is out of bounds (i.e. isValidIndex(fromIndex) == False)

insertAt[nothrow]

String& insertAt(Int index, Char c)

DOCTODO.

Parameters:
index - DOCTODO
c - DOCTODO
Returns:
DOCTODO

insertAt[nothrow]

String& insertAt(Int index, const Char* string)

DOCTODO.

Parameters:
index - DOCTODO
string - DOCTODO
Returns:
DOCTODO

insertAt[nothrow]

String& insertAt(Int index, const String& string)

DOCTODO.

Parameters:
index - DOCTODO
string - DOCTODO
Returns:
DOCTODO

isEmpty[nothrow, inline]

Bool isEmpty() const

DOCTODO.

Returns:
DOCTODO

isNewLine[nothrow, inline]

Bool isNewLine(Int index) const

DOCTODO.

Parameters:
index - DOCTODO
Returns:
DOCTODO

isValidIndex[nothrow, inline]

Bool isValidIndex(Int index) const

DOCTODO.

Parameters:
index - DOCTODO
Returns:
DOCTODO

lastIndexOf[nothrow]

Int lastIndexOf(Char c) const

Searches this string for the last occurance of the specified character.

Parameters:
c - character to search for
Returns:
the index of the last occurrence of the specified character in this string, or -1 if not found

lastIndexOf[nothrow]

Int lastIndexOf(Char c, Int fromIndex) const

Searches this string for the last occurance of the specified character, starting at the specified index (the search is performed backwards, that is towards the begining of this string).

Parameters:
c - character to search for
fromIndex - starting index within this string
Returns:
the index of the last occurrence of the specified character in this string, such that fromIndex >= index, or -1 if not found or fromIndex is out of bounds (i.e. isValidIndex(fromIndex) == False)

lastIndexOf[nothrow]

Int lastIndexOf(const Char* string) const

Searches this string for the last occurance of the specified string.

Parameters:
string - string to search for
Returns:
the index of the last occurrence of the specified string in this string, or -1 if not found

lastIndexOf[nothrow]

Int lastIndexOf(const Char* string, Int fromIndex) const

Searches this string for the last occurance of the specified string, starting at the specified index (the search is performed backwards, that is towards the begining of this string).

Parameters:
string - string to search for
fromIndex - starting index within this string
Returns:
the index of the last occurrence of the specified string in this string, such that fromIndex >= index, or -1 if not found or fromIndex is out of bounds (i.e. isValidIndex(fromIndex) == False)

lastIndexOf[nothrow]

Int lastIndexOf(const String& string) const

Searches this string for the last occurance of the specified string.

Parameters:
string - string to search for
Returns:
the index of the last occurrence of the specified string in this string, or -1 if not found

lastIndexOf[nothrow]

Int lastIndexOf(const String& string, Int fromIndex) const

Searches this string for the last occurance of the specified string, starting at the specified index (the search is performed backwards, that is towards the begining of this string).

Parameters:
string - string to search for
fromIndex - starting index within this string
Returns:
the index of the last occurrence of the specified string in this string, such that fromIndex >= index, or -1 if not found or fromIndex is out of bounds (i.e. isValidIndex(fromIndex) == False)

length[nothrow, inline]

Int length() const

Returns the number of characters in the string.

Returns:
the number of characters in the string

operator!=[nothrow, inline]

Bool operator!=(Char c) const

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

operator!=[nothrow, inline]

Bool operator!=(const Char* string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

operator+[nothrow, inline]

const Char* operator+() const

Retrieves the pointer to the character sequence of this string. If the string does not contain any characters this method returns a pointer to an empty string "".

Returns:
pointer to the character sequence of this string or an empty string "" if this string is empty

operator+=[nothrow, inline]

String& operator+=(const Char* string)

Appends the characters in the given string at the end of this string.

Parameters:
string - a string to append at the end of this string
Returns:
a reference to this string

operator+=[nothrow, inline]

String& operator+=(const String& string)

Appends the characters in the given string at the end of this string.

Parameters:
string - a string to append at the end of this string
Returns:
a reference to this string

operator+=[nothrow, inline]

String& operator+=(LatinChar c)

Appends the specified character at the end of this string.

Parameters:
c - a character to append at the end of this string
Returns:
a reference to this string

operator+=[nothrow, inline]

String& operator+=(UniChar c)

Appends the specified character at the end of this string.

Parameters:
c - a character to append at the end of this string
Returns:
a reference to this string

operator=[nothrow, inline]

String& operator=(Char c)

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

operator=[nothrow, inline]

String& operator=(const Char* string)

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

operator=[nothrow, inline]

String& operator=(const String& string)

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

operator==[nothrow, inline]

Bool operator==(Char c) const

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

operator==[nothrow, inline]

Bool operator==(const Char* string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

operator[][nothrow, inline]

Char& operator[](Int index)

DOCTODO.

Parameters:
index - DOCTODO
Returns:
DOCTODO

operator[][nothrow, inline]

const Char& operator[](Int index) const

DOCTODO.

Parameters:
index - DOCTODO
Returns:
DOCTODO

padLeft[nothrow]

String& padLeft(Int length, Char filling = appText(' '))

DOCTODO.

Parameters:
length - DOCTODO
filling - DOCTODO
Returns:
DOCTODO

padRight[nothrow]

String& padRight(Int length, Char filling = appText(' '))

DOCTODO.

Parameters:
length - DOCTODO
filling - DOCTODO
Returns:
DOCTODO

position[nothrow]

Position position(Int fromIndex, Int toIndex) const

Computes the line and column position within a string. The search for the NewLine characters is performed within the range specified by fromIndex and toIndex parameters.

Parameters:
fromIndex - starting index within the string
toIndex - the index at which the search is terminated and the computed line and position values are reported
Returns:
line and column position within the string

regionEquals[nothrow]

Bool regionEquals(const Char* string, Int fromIndex) const

DOCTODO.

Parameters:
string - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

regionEquals[nothrow]

Bool regionEquals(const Char c, Int fromIndex) const

DOCTODO.

Parameters:
c - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

regionEquals[nothrow]

Bool regionEquals(const String& string, Int fromIndex) const

DOCTODO.

Parameters:
string - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

regionEqualsIgnoreCase[nothrow]

Bool regionEqualsIgnoreCase(const Char* string, Int fromIndex) const

DOCTODO.

Parameters:
string - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

regionEqualsIgnoreCase[nothrow]

Bool regionEqualsIgnoreCase(const Char c, Int fromIndex) const

DOCTODO.

Parameters:
c - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

regionEqualsIgnoreCase[nothrow]

Bool regionEqualsIgnoreCase(const String& string, Int fromIndex) const

DOCTODO.

Parameters:
string - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

regionMatches[nothrow]

Bool regionMatches(const String& pattern, Int fromIndex = 0) const

DOCTODO.

Parameters:
pattern - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

regionMatchesIgnoreCase[nothrow]

Bool regionMatchesIgnoreCase(const String& pattern, Int fromIndex = 0) const

DOCTODO.

Parameters:
pattern - DOCTODO
fromIndex - DOCTODO
Returns:
DOCTODO

removeAt[nothrow]

String& removeAt(Int index)

DOCTODO.

Parameters:
index - DOCTODO
Returns:
DOCTODO

removeRange[nothrow]

String& removeRange(Int fromIndex, Int toIndex)

DOCTODO.

Parameters:
fromIndex - DOCTODO
toIndex - DOCTODO
Returns:
DOCTODO

replace[nothrow]

String& replace(Char oldChar, Char newChar)

DOCTODO.

Parameters:
oldChar - DOCTODO
newChar - DOCTODO
Returns:
DOCTODO

replace[nothrow]

String& replace(const String& oldString, const String& newString)

DOCTODO.

Parameters:
oldString - DOCTODO
newString - DOCTODO
Returns:
DOCTODO

reverse[nothrow]

String& reverse()

DOCTODO.

Returns:
DOCTODO

setCharAt[nothrow, inline]

Void setCharAt(Int index, Char c)

Sets a character at the specified index in this string. If index is out of bounds (i.e. isValidIndex(index) == False) or c == 0 no action is performed.

Parameters:
index - an index to set character at
c - new character

skipNewLine[nothrow]

Int skipNewLine(Int fromIndex = 0) const

Skips the NewLine characters starting at the specified index. The NewLine characters are: U+000d, U+000a, U+2028, U+2029.

Parameters:
fromIndex - starting index within the string
Returns:
the index just after the last encountered NewLine character, such that fromIndex <= index

skipToNewLine[nothrow]

Int skipToNewLine(Int fromIndex = 0) const

Skips until the first NewLine character starting at the specified index. The NewLine characters are: U+000d, U+000a, U+2028, U+2029.

Parameters:
fromIndex - starting index within the string
Returns:
the index of the first encountered NewLine character, such that fromIndex <= index

skipToWhitespace[nothrow]

Int skipToWhitespace(Int fromIndex = 0) const

Skips until the first Whitespace character starting at the specified index.

Parameters:
fromIndex - starting index within the string
Returns:
the index of the first encountered Whitespace character, such that fromIndex <= index
See Also:
Chr::isWhiteSpace

skipWhitespace[nothrow]

Int skipWhitespace(Int fromIndex = 0) const

Skips the Whitespace characters starting at the specified index.

Parameters:
fromIndex - starting index within the string
Returns:
the index just after the last encountered Whitespace character, such that fromIndex <= index
See Also:
Chr::isWhiteSpace

split[nothrow]

Containers::Array<String> split(Int fromIndex = 0, const Delimiter& delimeter = WhiteSpaceDelimiter()) const

DOCTODO.

Parameters:
fromIndex - DOCTODO
delimeter - DOCTODO
Returns:
DOCTODO

startsWith[nothrow]

Bool startsWith(Char c) const

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

startsWith[nothrow]

Bool startsWith(const Char* string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

startsWith[nothrow]

Bool startsWith(const String& string) const

DOCTODO.

Parameters:
string - DOCTODO
Returns:
DOCTODO

substring[nothrow, inline]

String substring(Int fromIndex) const

Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string.

For instance:
        "unhappy".substring(2) returns "happy"
        "Harbison".substring(3) returns "bison"
        "emptiness".substring(9) returns "" (an empty string)
Parameters:
fromIndex - the start index, inclusive
Returns:
a substring of this string

substring[nothrow, inline]

String substring(Int fromIndex, Int toIndex) const

Returns a new string that is a substring of this string. The substring begins at the specified fromIndex and extends to the character at index toIndex - 1. Thus the length of the substring is toIndex - fromIndex.

For instance:
        "hamburger".substring(4, 8) returns "urge"
        "smiles".substring(1, 5) returns "mile"
Parameters:
fromIndex - the start index, inclusive
toIndex - the end index, exclusive
Returns:
a substring of this string

toBool[nothrow, inline]

Bool toBool(Int fromIndex = 0) const

Attempts to parse a string and convert the result into a boolean number.

Parameters:
fromIndex - index at which to start parsing
Returns:
a boolean number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toBool

toBool[nothrow]

Bool toBool(Int fromIndex, Int& parsedLength) const

Attempts to parse a string and convert the result into a boolean number.

Parameters:
fromIndex - index at which to start parsing
parsedLength - accumulates the number of characters parsed upon successful conversion or unchanged if the string did not contain a recognizable number format
Returns:
a boolean number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toBool

toDouble[nothrow, inline]

Double toDouble(Int fromIndex = 0) const

Attempts to parse a string and convert the result into a floating-point number.

Parameters:
fromIndex - index at which to start parsing
Returns:
a floating-point number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toDouble

toDouble[nothrow]

Double toDouble(Int fromIndex, Int& parsedLength) const

Attempts to parse a string and convert the result into a floating-point number.

Parameters:
fromIndex - index at which to start parsing
parsedLength - accumulates the number of characters parsed upon successful conversion or unchanged if the string did not contain a recognizable number format
Returns:
a floating-point number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toDouble

toFloat[nothrow, inline]

Float toFloat(Int fromIndex = 0) const

Attempts to parse a string and convert the result into a floating-point number.

Parameters:
fromIndex - index at which to start parsing
Returns:
a floating-point number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toFloat

toFloat[nothrow]

Float toFloat(Int fromIndex, Int& parsedLength) const

Attempts to parse a string and convert the result into a floating-point number.

Parameters:
fromIndex - index at which to start parsing
parsedLength - accumulates the number of characters parsed upon successful conversion or unchanged if the string did not contain a recognizable number format
Returns:
a floating-point number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toFloat

toInt[nothrow, inline]

Int toInt(Int fromIndex = 0) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
Returns:
an integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toInt

toInt[nothrow]

Int toInt(Int fromIndex, Int& parsedLength) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
parsedLength - accumulates the number of characters parsed upon successful conversion or unchanged if the string did not contain a recognizable number format
Returns:
an integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toInt

toLong[nothrow, inline]

Long toLong(Int fromIndex = 0) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
Returns:
integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toLong

toLong[nothrow]

Long toLong(Int fromIndex, Int& parsedLength) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
parsedLength - accumulates the number of characters parsed upon successful conversion or unchanged if the string did not contain a recognizable number format
Returns:
integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toLong

toLowerCase[nothrow]

String& toLowerCase()

Converts the characters of this string to lower case.

Returns:
a reference to this string
See Also:
Chr::toLowerCase

toString[nothrow, inline]

String toString() const

Returns a copy of a string.

Returns:
a copy of a string

toUInt[nothrow, inline]

UInt toUInt(Int fromIndex = 0) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
Returns:
integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toUInt

toUInt[nothrow]

UInt toUInt(Int fromIndex, Int& parsedLength) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
parsedLength - accumulates the number of characters parsed upon successful conversion or unchanged if the string did not contain a recognizable number format
Returns:
integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toUInt

toULong[nothrow, inline]

ULong toULong(Int fromIndex = 0) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
Returns:
integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toULong

toULong[nothrow]

ULong toULong(Int fromIndex, Int& parsedLength) const

Attempts to parse a string and convert the result into an integer number.

Parameters:
fromIndex - index at which to start parsing
parsedLength - accumulates the number of characters parsed upon successful conversion or unchanged if the string did not contain a recognizable number format
Returns:
integer number representing the result of the conversion or value 0 if the string did not contain a recognizable number format
See Also:
Str::toULong

toUpperCase[nothrow]

String& toUpperCase()

Converts the characters of this string to upper case.

Returns:
a reference to this string
See Also:
Chr::toUpperCase

toXml[nothrow, inline]

String toXml() const

Returns an XML representation of a string.

Returns:
an XML representation of a string

trim[nothrow]

String& trim(Char c)

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

trimCapacity[nothrow, inline]

String& trimCapacity()

Attempts to reduce the internal storage used for holding the character sequence to the actual size of the string.

Returns:
a reference to this string

trimLeft[nothrow]

String& trimLeft(Char c)

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

trimRight[nothrow]

String& trimRight(Char c)

DOCTODO.

Parameters:
c - DOCTODO
Returns:
DOCTODO

trimWhitespace[nothrow]

String& trimWhitespace()

DOCTODO.

Returns:
DOCTODO

trimWhitespaceLeft[nothrow]

String& trimWhitespaceLeft()

DOCTODO.

Returns:
DOCTODO

trimWhitespaceRight[nothrow]

String& trimWhitespaceRight()

DOCTODO.

Returns:
DOCTODO

value[nothrow, inline]

Char* value()

Retrieves the pointer to the character sequence of this string.

Returns:
pointer to the character sequence of this string

value[nothrow, inline]

const Char* value() const

Retrieves the pointer to the character sequence of this string.

Returns:
pointer to the character sequence of this string

 

Friend Detail

operator<<

friend Io::ISerializer& operator<<(Io::ISerializer& serializer, const String& string)

Serializes the state of a String object.

Parameters:
string - a string object to serialize
serializer - a serializer to receive state data
Returns:
the reference to the serializer

operator>>

friend Io::IDeserializer& operator>>(Io::IDeserializer& deserializer, String& string)

Deserializes the state of a String object.

Parameters:
string - a string object to deserialize
deserializer - a deserializer to retrieve state data from
Returns:
the reference to the deserializer


SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND