#include <pstring.h>
Inheritance diagram for PString:
Construction | |
enum | ConversionType { Pascal, Basic, Literal, Signed, Unsigned, Decimal, Exponent, Printf, NumConversionTypes } |
PINLINE | PString () |
PINLINE | PString (const PString &str) |
PINLINE | PString (const std::string &str) |
PString (const char *cstr) | |
PString (const WORD *ustr) | |
PString (const char *cstr, PINDEX len) | |
PString (const WORD *ustr, PINDEX len) | |
PString (const PWORDArray &ustr) | |
PString (char ch) | |
PString (short n) | |
PString (unsigned short n) | |
PString (int n) | |
PString (unsigned int n) | |
PString (long n) | |
PString (unsigned long n) | |
PString (PInt64 n) | |
PString (PUInt64 n) | |
PString (ConversionType type, const char *str,...) | |
PString (ConversionType type, long value, unsigned base=10) | |
PString (ConversionType type, double value, unsigned places) | |
PString & | operator= (const PString &str) |
PString & | operator= (const char *cstr) |
PString & | operator= (char ch) |
PString & | operator= (short n) |
PString & | operator= (unsigned short n) |
PString & | operator= (int n) |
PString & | operator= (unsigned int n) |
PString & | operator= (long n) |
PString & | operator= (unsigned long n) |
PString & | operator= (PInt64 n) |
PString & | operator= (PUInt64 n) |
virtual PString & | MakeEmpty () |
static PString | Empty () |
Concatenation operators | |
PString | operator+ (const PString &str) const |
PString | operator+ (const char *cstr) const |
PString | operator+ (char ch) const |
PString & | operator+= (const PString &str) |
PString & | operator+= (const char *cstr) |
PString & | operator+= (char ch) |
PString | operator & (const PString &str) const |
PString | operator & (const char *cstr) const |
PString | operator & (char ch) const |
PString & | operator &= (const PString &str) |
PString & | operator &= (const char *cstr) |
PString & | operator &= (char ch) |
PString | operator+ (const char *cstr, const PString &str) |
PString | operator+ (char c, const PString &str) |
PString | operator & (const char *cstr, const PString &str) |
PString | operator & (char ch, const PString &str) |
Conversion functions | |
PString & | sprintf (const char *cfmt,...) |
PString & | vsprintf (const PString &fmt, va_list args) |
PString & | vsprintf (const char *cfmt, va_list args) |
long | AsInteger (unsigned base=10) const |
DWORD | AsUnsigned (unsigned base=10) const |
PInt64 | AsInt64 (unsigned base=10) const |
PUInt64 | AsUnsigned64 (unsigned base=10) const |
double | AsReal () const |
PWORDArray | AsUCS2 () const |
PBYTEArray | ToPascal () const |
PString | ToLiteral () const |
operator const unsigned char * () const | |
PString | psprintf (const char *cfmt,...) |
PString | pvsprintf (const char *cfmt, va_list args) |
PString | pvsprintf (const PString &fmt, va_list args) |
Public Member Functions | |
Overrides from class PObject | |
virtual PObject * | Clone () const |
virtual Comparison | Compare (const PObject &obj) const |
virtual void | PrintOn (ostream &strm) const |
virtual void | ReadFrom (istream &strm) |
virtual PINDEX | HashFunction () const |
Overrides from class PContainer | |
virtual BOOL | SetSize (PINDEX newSize) |
virtual BOOL | IsEmpty () const |
virtual BOOL | MakeUnique () |
Size/Length functions | |
BOOL | MakeMinimumSize () |
PINLINE PINDEX | GetLength () const |
bool | operator! () const |
Comparison operators | |
bool | operator *= (const PString &str) const |
bool | operator== (const PObject &str) const |
bool | operator!= (const PObject &str) const |
bool | operator< (const PObject &str) const |
bool | operator> (const PObject &str) const |
bool | operator<= (const PObject &str) const |
bool | operator>= (const PObject &str) const |
bool | operator *= (const char *cstr) const |
bool | operator== (const char *cstr) const |
bool | operator!= (const char *cstr) const |
bool | operator< (const char *cstr) const |
bool | operator> (const char *cstr) const |
bool | operator<= (const char *cstr) const |
bool | operator>= (const char *cstr) const |
Comparison | NumCompare (const PString &str, PINDEX count=P_MAX_INDEX, PINDEX offset=0) const |
Comparison | NumCompare (const char *cstr, PINDEX count=P_MAX_INDEX, PINDEX offset=0) const |
Search & replace functions | |
PINDEX | Find (char ch, PINDEX offset=0) const |
PINDEX | Find (const PString &str, PINDEX offset=0) const |
PINDEX | Find (const char *cstr, PINDEX offset=0) const |
PINDEX | FindLast (char ch, PINDEX offset=P_MAX_INDEX) const |
PINDEX | FindLast (const PString &str, PINDEX offset=P_MAX_INDEX) const |
PINDEX | FindLast (const char *cstr, PINDEX offset=P_MAX_INDEX) const |
PINDEX | FindOneOf (const PString &set, PINDEX offset=0) const |
PINDEX | FindOneOf (const char *cset, PINDEX offset=0) const |
PINDEX | FindRegEx (const PRegularExpression ®ex, PINDEX offset=0) const |
BOOL | FindRegEx (const PRegularExpression ®ex, PINDEX &pos, PINDEX &len, PINDEX offset=0, PINDEX maxPos=P_MAX_INDEX) const |
void | Replace (const PString &target, const PString &subs, BOOL all=FALSE, PINDEX offset=0) |
void | Splice (const PString &str, PINDEX pos, PINDEX len=0) |
void | Splice (const char *cstr, PINDEX pos, PINDEX len=0) |
void | Delete (PINDEX start, PINDEX len) |
Sub-string functions | |
PString | operator() (PINDEX start, PINDEX end) const |
PString | Left (PINDEX len) const |
PString | Right (PINDEX len) const |
PString | Mid (PINDEX start, PINDEX len=P_MAX_INDEX) const |
PString | LeftTrim () const |
PString | RightTrim () const |
PString | Trim () const |
PString | ToLower () const |
PString | ToUpper () const |
PStringArray | Tokenise (const PString &separators, BOOL onePerSeparator=TRUE) const |
PStringArray | Tokenise (const char *cseparators, BOOL onePerSeparator=TRUE) const |
PStringArray | Lines () const |
Protected Member Functions | |
void | InternalFromUCS2 (const WORD *ptr, PINDEX len) |
virtual Comparison | InternalCompare (PINDEX offset, char c) const |
virtual Comparison | InternalCompare (PINDEX offset, PINDEX length, const char *cstr) const |
PString (int dummy, const PString *str) |
An important feature of the string class, which is not present in other container classes, is that when the string contents is changed, that is resized or elements set, the string is "dereferenced", and a duplicate made of its contents. That is this instance of the array is disconnected from all other references to the string data, if any, and a new string array contents created. For example consider the following: {verbatim} PString s1 = "String"; // New array allocated and set to "String" PString s2 = s1; // s2 has pointer to same array as s1 and reference count is 2 for both s1[0] = 's'; // Breaks references into different strings {verbatim} at the end s1 is "string" and s2 is "String" both with reference count of 1.
The functions that will "break" a reference are SetSize()#, SetMinSize()#, GetPointer()#, SetAt()# and operator[]#.
Note that the array is a '' terminated string as in C strings. Thus the memory allocated, and the length of the string may be different values.
Also note that the PString is inherently an 8 bit string. The character set is not defined for most operations and it may be any 8 bit character set. However when conversions are being made to or from 2 byte formats then the PString is assumed to be the UTF-8 format. The 2 byte format is nominally UCS-2 (aka BMP string) and while it is not exactly the same as UNICODE they are compatible enough for them to be treated the same for most real world usage.
|
|
|
Construct an empty string. This will have one character in it which is the '' character. |
|
Create a new reference to the specified string. The string memory is not copied, only the pointer to the data.
|
|
Create a new string from the specified std::string |
|
Create a string from the C string array. This is most commonly used with a literal string, eg "hello". A new memory block is allocated of a size sufficient to take the length of the string and its terminating '' character. If UCS-2 is used then each char from the char pointer is mapped to a single UCS-2 character.
|
|
Create a string from the UCS-2 string array. A new memory block is allocated of a size sufficient to take the length of the string and its terminating '' character.
|
|
Create a string from the array. A new memory block is allocated of a size equal to len# plus one which is sufficient to take the string and a terminating '' character. If UCS-2 is used then each char from the char pointer is mapped to a single UCS-2 character. Note that this function will allow a string with embedded '' characters to be created, but most of the functions here will be unable to access characters beyond the first ''. Furthermore, if the MakeMinimumSize()# function is called, all data beyond that first #''# character will be lost.
|
|
Create a string from the UCS-2 array. A new memory block is allocated of a size equal to len# plus one which is sufficient to take the string and a terminating '' character. Note that this function will allow a string with embedded '' characters to be created, but most of the functions here will be unable to access characters beyond the first ''. Furthermore, if the MakeMinimumSize()# function is called, all data beyond that first #''# character will be lost.
|
|
Create a string from the UCS-2 array. A new memory block is allocated of a size equal to len# plus one which is sufficient to take the string and a terminating '' character. Note that this function will allow a string with embedded '' characters to be created, but most of the functions here will be unable to access characters beyond the first ''. Furthermore, if the MakeMinimumSize()# function is called, all data beyond that first #''# character will be lost.
|
|
Create a string from the single character. This is most commonly used as a type conversion constructor when a literal character, eg 'A' is used in a string expression. A new memory block is allocated of two characters to take the char and its terminating '' character. If UCS-2 is used then the char is mapped to a single UCS-2 character.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Create a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
|
|
|
|
|
|
|
|
Convert the string to an integer value using the specified number base. All characters up to the first illegal character for the number base are converted. Case is not significant for bases greater than 10. The number base may only be from 2 to 36 and the function will assert if it is not in this range. This function uses the standard C library strtoq()# or strtoul()# function.
|
|
Convert the string to an integer value using the specified number base. All characters up to the first illegal character for the number base are converted. Case is not significant for bases greater than 10. The number base may only be from 2 to 36 and the function will assert if it is not in this range. This function uses the standard C library strtol()# function.
|
|
Convert the string to a floating point number. This number may be in decimal or exponential form. All characters up to the first illegal character for a floting point number are converted. This function uses the standard C library strtod()# function.
|
|
Convert UTF-8 string to UCS-2. Note the resultant PWORDArray will have the trailing null included. |
|
Convert the string to an integer value using the specified number base. All characters up to the first illegal character for the number base are converted. Case is not significant for bases greater than 10. The number base may only be from 2 to 36 and the function will assert if it is not in this range. This function uses the standard C library strtoul()# function.
|
|
Convert the string to an integer value using the specified number base. All characters up to the first illegal character for the number base are converted. Case is not significant for bases greater than 10. The number base may only be from 2 to 36 and the function will assert if it is not in this range. This function uses the standard C library strtouq()# or strtoul()# function.
|
|
Make a complete duplicate of the string. Note that the data in the array of characters is duplicated as well and the new object is a unique reference to that data. Reimplemented in PCaselessString. |
|
Get the relative rank of the two strings. The system standard function, eg strcmp(), is used.
|
|
Remove the substring from the string. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Return an empty string. |
|
|
|
Locate the position within the string of the substring.
|
|
Locate the position within the string of the character.
|
|
Locate the position of the last matching substring. Locate the position within the string of the last matching character or substring. The search will begin at the character offset provided, moving backward through the string. If offset# is beyond the length of the string, then the search begins at the end of the string. If offset# is zero then the function always returns P_MAX_INDEX#. The matching will be for identical character or string. If a search ignoring case is required then the string should be converted to a PCaselessString# before the search is made.
|
|
Locate the position of the last matching substring.
|
|
Locate the position of the last matching character.
|
|
Locate the position of one of the characters in the set. The search will begin at the character offset provided. If offset# is beyond the length of the string, then the function will always return P_MAX_INDEX#. The matching will be for identical character or string. If a search ignoring case is required then the string should be converted to a PCaselessString# before the search is made.
|
|
Locate the position of one of the characters in the set.
|
|
Locate the position within the string of one of the regular expression. The search will begin at the character offset provided. If offset# is beyond the length of the string, then the function will always return P_MAX_INDEX#.
|
|
Locate the position within the string of one of the regular expression. The search will begin at the character offset provided. If offset# is beyond the length of the string, then the function will always return P_MAX_INDEX#.
|
|
Determine the length of the null terminated string. This is different from PContainer::GetSize()# which returns the amount of memory allocated to the string. This is often, though no necessarily, one larger than the length of the string.
|
|
Calculate a hash value for use in sets and dictionaries. The hash function for strings will produce a value based on the sum of the first three characters of the string. This is a fairly basic function and make no assumptions about the string contents. A user may descend from PString and override the hash function if they can take advantage of the types of strings being used, eg if all strings start with the letter 'A' followed by 'B or 'C' then the current hash function will not perform very well.
|
|
Reimplemented in PCaselessString. |
|
Reimplemented in PCaselessString. |
|
|
|
Determine if the string is empty. This is semantically slightly different from the usual PContainer::IsEmpty()# function. It does not test for PContainer::GetSize()# equal to zero, it tests for GetLength()# equal to zero.
|
|
Extract a portion of the string into a new string. The original string is not changed and a new unique reference to a string is returned. A substring from the beginning of the string for the number of characters specified is extracted. If len# is greater than the length of the string then all characters to the end of the string are returned. If len# is zero then an empty string is returned.
|
|
Create a string consisting of all characters from the source string except all spaces at the beginning of the string. The original string is not changed and a new unique reference to a string is returned.
|
|
Split the string into individual lines. The line delimiters may be a carriage return (''), a line feed (' The Tokenise()# function should not be used to split a string into lines as a #"\r\n"# pair consitutes a single line ending. The Tokenise()# function would produce a blank line in between them.
|
|
Make the current string empty Reimplemented in PStringStream. |
|
Set the actual memory block array size to the minimum required to hold the current string contents. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Make this instance to be the one and only reference to the container contents. This implicitly does a clone of the contents of the container to make a unique reference. If the instance was already unique then the function does nothing.
|
|
Extract a portion of the string into a new string. The original string is not changed and a new unique reference to a string is returned. A substring from the start# position for the number of characters specified is extracted. If len# is greater than the length of the string from the start# position then all characters to the end of the string are returned. If start# is greater than the length of the string or len# is zero then an empty string is returned.
|
|
Compare a string against a substring of the object. This will compare at most count# characters of the string, starting at the specified offset#, against that many characters of the str# parameter. If count# greater than the length of the str# parameter then the actual length of str# is used. If count# and the length of str# are greater than the length of the string remaining from the offset# then FALSE is returned.
|
|
Compare a string against a substring of the object. This will compare at most count# characters of the string, starting at the specified offset#, against that many characters of the str# parameter. If count# greater than the length of the str# parameter then the actual length of str# is used. If count# and the length of str# are greater than the length of the string remaining from the offset# then FALSE is returned.
|
|
Concatenate a single character to a PString to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The ch# parameter is typically a literal, eg: {verbatim} myStr = aStr & '!'; {verbatim} This function differes from operator+ in that it assures there is at least one space between the strings. Exactly one space is added if there is not a space at the end of the first or beggining of the last string.
|
|
Concatenate a C string to a PString to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The cstr# parameter is typically a literal string, eg: {verbatim} myStr = aStr & "fred"; {verbatim} This function differes from operator+ in that it assures there is at least one space between the strings. Exactly one space is added if there is not a space at the end of the first or beggining of the last string.
|
|
Concatenate two strings to produce a third. The original strings are not modified, an entirely new unique reference to a string is created.
|
|
Concatenate a character to a PString, modifiying that string. The ch# parameter is typically a literal string, eg: {verbatim} myStr &= '!'; {verbatim} This function differes from operator+ in that it assures there is at least one space between the strings. Exactly one space is added if there is not a space at the end of the first or beggining of the last string.
|
|
Concatenate a C string to a PString, modifiying that string. The cstr# parameter is typically a literal string, eg: {verbatim} myStr &= "fred"; {verbatim} This function differes from operator+ in that it assures there is at least one space between the strings. Exactly one space is added if there is not a space at the end of the first or beggining of the last string.
|
|
Concatenate a string to another string, modifiying that string.
|
|
Compare a PString to a C string using a case insensitive compare function. The cstr# parameter is typically a literal string, eg: {verbatim} if (myStr == "fred") {verbatim}
|
|
Compare two strings using case insensitive comparison.
|
|
Get the internal buffer as a pointer to unsigned characters. The standard "operator const char *" function is provided by the PCharArray# ancestor class.
|
|
Determine if the string is NOT empty. This is semantically identical to executing !IsEmpty() on the string.
|
|
Compare a PString to a C string using the PObject::Compare()# function. The cstr# parameter is typically a literal string, eg: {verbatim} if (myStr != "fred") {verbatim}
|
|
Compare two strings using the PObject::Compare()# function. This is identical to the PObject# class function but is necessary due to other overloaded versions.
|
|
Extract a portion of the string into a new string. The original string is not changed and a new unique reference to a string is returned. The substring is returned inclusive of the characters at the start# and end# positions. If the end# position is greater than the length of the string then all characters from the start# up to the end of the string are returned. If start# is greater than the length of the string or end# is before start# then an empty string is returned.
|
|
Concatenate a single character to a PString to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The ch# parameter is typically a literal, eg: {verbatim} myStr = aStr + '!'; {verbatim}
|
|
Concatenate a C string to a PString to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The cstr# parameter is typically a literal string, eg: {verbatim} myStr = aStr + "fred"; {verbatim}
|
|
Concatenate two strings to produce a third. The original strings are not modified, an entirely new unique reference to a string is created.
|
|
Concatenate a single character to a PString. The ch# parameter is typically a literal, eg: {verbatim} myStr += '!'; {verbatim}
Reimplemented in PFilePath. |
|
Concatenate a C string to a PString, modifiying that string. The cstr# parameter is typically a literal string, eg: {verbatim} myStr += "fred"; {verbatim}
Reimplemented in PFilePath. |
|
Concatenate a string to another string, modifiying that string.
Reimplemented in PFilePath. |
|
Compare a PString to a C string using the PObject::Compare()# function. The cstr# parameter is typically a literal string, eg: {verbatim} if (myStr < "fred") {verbatim}
|
|
Compare two strings using the PObject::Compare()# function. This is identical to the PObject# class function but is necessary due to other overloaded versions.
|
|
Compare a PString to a C string using the PObject::Compare()# function. The cstr# parameter is typically a literal string, eg: {verbatim} if (myStr <= "fred") {verbatim}
|
|
Compare two strings using the PObject::Compare()# function. This is identical to the PObject# class function but is necessary due to other overloaded versions.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign a string from the integer type. This will create a simple base 10, shortest length conversion of the integer (with sign character if appropriate) into the string.
|
|
Assign the character to the current object. The current instance then becomes a unique reference to a copy of the character parameter. eg: {verbatim} myStr = 'A'; {verbatim}
Reimplemented in PCaselessString, PStringStream, and PHTML. |
|
Assign the C string to the current object. The current instance then becomes a unique reference to a copy of the cstr# parameter. The cstr# parameter is typically a literal string, eg: {verbatim} myStr = "fred"; {verbatim}
Reimplemented in PFilePath, PDirectory, PCaselessString, PStringStream, and PHTML. |
|
Assign the string to the current object. The current instance then becomes another reference to the same string in the str# parameter.
Reimplemented in PFilePath, PDirectory, PCaselessString, PStringStream, and PHTML. |
|
Compare a PString to a C string using the #Compare()## function. The cstr# parameter is typically a literal string, eg: {verbatim} if (myStr == "fred") {verbatim}
|
|
Compare two strings using the PObject::Compare()# function. This is identical to the PObject# class function but is necessary due to other overloaded versions.
|
|
Compare a PString to a C string using the PObject::Compare()# function. The cstr# parameter is typically a literal string, eg: {verbatim} if (myStr > "fred") {verbatim}
|
|
Compare two strings using the PObject::Compare()# function. This is identical to the PObject# class function but is necessary due to other overloaded versions.
|
|
Compare a PString to a C string using the PObject::Compare()# function. The cstr# parameter is typically a literal string, eg: {verbatim} if (myStr >= "fred") {verbatim}
|
|
Compare two strings using the PObject::Compare()# function. This is identical to the PObject# class function but is necessary due to other overloaded versions.
|
|
Output the string to the specified stream.
Reimplemented from PCharArray. |
|
Input the string from the specified stream. This will read all characters until a end of line is reached. The end of line itself is { not} placed in the string, however it { is} removed from the stream.
Reimplemented from PCharArray. |
|
Locate the substring within the string and replace it with the specifed substring. The search will begin at the character offset provided. If offset# is beyond the length of the string, then the function will do nothing. The matching will be for identical character or string. If a search ignoring case is required then the string should be converted to a PCaselessString# before the search is made.
|
|
Extract a portion of the string into a new string. The original string is not changed and a new unique reference to a string is returned. A substring from the end of the string for the number of characters specified is extracted. If len# is greater than the length of the string then all characters to the beginning of the string are returned. If len# is zero then an empty string is returned.
|
|
Create a string consisting of all characters from the source string except all spaces at the end of the string. The original string is not changed and a new unique reference to a string is returned.
|
|
Set the size of the string. A new string may be allocated to accomodate the new number of characters. If the string increases in size then the new characters are initialised to zero. If the string is made smaller then the data beyond the new size is lost. Note that this function will break the current instance from multiple references to an array. A new array is allocated and the data from the old array copied to it.
|
|
Splice the string into the current string at the specified position. The specified number of bytes are removed from the string. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Splice the string into the current string at the specified position. The specified number of bytes are removed from the string. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Concatenate a formatted output to the string. This is identical to the standard C library sprintf()# function, but appends its output to the string. This function makes the assumption that there is less the 1000 characters of formatted output. The function will assert if this occurs. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Split the string into an array of substrings. Divide the string into an array of substrings delimited by characters from the specified set. There are two options for the tokenisation, the first is where the onePerSeparator# is TRUE. This form will produce a token for each delimiter found in the set. Thus the string ",two,three,,five" would be split into 5 substrings; "", "two", "three", "" and "five". The second form where onePerSeparator# is FALSE is used where consecutive delimiters do not constitute a empty token. In this case the string " a list of words " would be split into 4 substrings; "a", "list", "of" and "words". There is an important distinction when there are delimiters at the beginning or end of the source string. In the first case there will be empty strings at the end of the array and in the second the delimiters are ignored.
|
|
Split the string into an array of substrings.
|
|
Convert the string to C literal string format. This will convert non printable characters to the form or for standard control characters such as line feed, to
|
|
Create a string consisting of all characters from the source string with all upper case letters converted to lower case. The original string is not changed and a new unique reference to a string is returned.
|
|
Convert a standard null terminated string to a "pascal" style string. This consists of a songle byte for the length of the string and then the string characters following it. This function will assert if the string is greater than 255 characters in length.
|
|
Create a string consisting of all characters from the source string with all lower case letters converted to upper case. The original string is not changed and a new unique reference to a string is returned.
|
|
Create a string consisting of all characters from the source string except all spaces at the beginning and end of the string. The original string is not changed and a new unique reference to a string is returned.
|
|
Concatenate a formatted output to the string. This is identical to the standard C library vsprintf()# function, but appends its output to the string. This function makes the assumption that there is less the 1000 characters of formatted output. The function will assert if this occurs. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Concatenate a formatted output to the string.
|
|
Concatenate a PString to a single character to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The c# parameter is typically a literal, eg: {verbatim} myStr = '!' & aStr; {verbatim} This function differes from operator+# in that it assures there is at least one space between the strings. Exactly one space is added if there is not a space at the end of the first or beggining of the last string.
|
|
Concatenate a PString to a C string to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The cstr# parameter is typically a literal string, eg: {verbatim} myStr = "fred" & aStr; {verbatim} This function differes from operator+ in that it assures there is at least one space between the strings. Exactly one space is added if there is not a space at the end of the first or beggining of the last string.
|
|
Concatenate a PString to a single character to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The c# parameter is typically a literal, eg: {verbatim} myStr = '!' + aStr; {verbatim}
|
|
Concatenate a PString to a C string to produce a third. The original string is not modified, an entirely new unique reference to a string is created. The cstr# parameter is typically a literal string, eg: {verbatim} myStr = "fred" + aStr; {verbatim}
|
|
Produce formatted output as a string. This is identical to the standard C library sprintf()# function, but sends its output to a PString#. This function makes the assumption that there is less the 1000 characters of formatted output. The function will assert if this occurs. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Produce formatted output as a string. This is identical to the standard C library vsprintf()# function, but sends its output to a PString#. This function makes the assumption that there is less the 1000 characters of formatted output. The function will assert if this occurs. Note that this function will break the current instance from multiple references to the string. A new string buffer is allocated and the data from the old string buffer copied to it.
|
|
Produce formatted output as a string.
|