String Class Reference


Detailed Description

String object are mutable operations will affect the string content.

exceptions are the substring and strip methods (strip is just a particular case of substring). To preserve the original String when calling mutator methods just duplicate the String before calling the method, for instance: myString.dup.toLower(). Method naming is close to the functions on the phobos string module

Todo:
template for StringD and StringW?


Public Member Functions

 this ()
 Creates a new empty String.
 this (CHAR[] str)
 Creates a new String that contains the array passed.
 this (String string) body
 Copy constructor.
 this (void *str)
 Creates a String from a pointer to memory.
 this (char *str, int length)
 Create a String from a pointer to chars.
 this (char c)
 Creates a String from the char.
 this (int i)
 creates a String that is the representation of the int passed.
 this (uint ui)
 creates a String that is the representation of the uint passed
 this (long l)
 creates a String that is the representation of the long passed
 this (double d)
 creates a String that is the representation of the double passed
 this (bit b)
 Creates a string that is "0" or "1".

Static Public Member Functions

 this ()
 Creates the static variables.


Member Function Documentation

String::this bit  b  ) 
 

Creates a string that is "0" or "1".

This is to keep compatilility - WILL CHANGE(?) - to "false" or "true"?

String::this double  d  ) 
 

creates a String that is the representation of the double passed

Parameters:
d the double to be converted to String

String::this long  l  ) 
 

creates a String that is the representation of the long passed

Parameters:
l the long to be converted to String

String::this uint  ui  ) 
 

creates a String that is the representation of the uint passed

Parameters:
ui the uint to be converted to String

String::this int  i  ) 
 

creates a String that is the representation of the int passed.

Parameters:
i the int to be converted to String

String::this char  c  ) 
 

Creates a String from the char.

The String will a the lengh of 1

Parameters:
c The char

String::this char *  str,
int  length
 

Create a String from a pointer to chars.

Parameters:
str the pointer to chars
length the length of the new String

String::this void *  str  ) 
 

Creates a String from a pointer to memory.

The string length will be the length from the pointer until the next null char;

Parameters:
str The pointer.

String::this String  string  ) 
 

Copy constructor.

The String to copy is duplicated.

Parameters:
string The String to copy

String::this CHAR[]  str  ) 
 

Creates a new String that contains the array passed.

The array is duplicated. To make a string point to an existing array create an string string and them set it with the point() method.

Parameters:
str the array that defines the initial value of this String

String::this  ) 
 

Creates a new empty String.

String::this  )  [static]
 

Creates the static variables.


SourceForge.net Logo DSource.org Logo digitalmars.com Logo