Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Text Class Reference

List of all members.

Static Public Member Functions

char[] replace (char[] source, char match, char replacement)
int indexOf (char[] source, char match)
int indexOf (char[] source, char match, int start)
int indexOf (char[] source, char[] match)
int indexOf (char[] source, char[] match, int start)
char[] trim (char[] source)
int atoi (char[] digits)
int atoi (char[] digits, int radix)
char[] itoa (char[] s, long i)
char[] toString (int i)
long atod (char[] date)
char[] dtoa (char[] buffer, long time)
char[] tolower (inout char[] src)

Detailed Description

Placeholder for a variety of wee functions. Some of these are handy for Java programmers, but the primary reason for their existance is that they don't allocate memory (unlike Phobos). That is, processing is performed in-place or within a client- provided temporary buffer.

Definition at line 63 of file Text.d.


Member Function Documentation

char [] replace char[]  source,
char  match,
char  replacement
[inline, static]
 

Replace all instances of one char with another (in place)

Definition at line 71 of file Text.d.

References memchr().

int indexOf char[]  source,
char  match
[inline, static]
 

Return the index of the first instance of 'match'

Definition at line 92 of file Text.d.

Referenced by indexOf().

int indexOf char[]  source,
char  match,
int  start
[inline, static]
 

Return the index of the first instance of 'match', starting at position 'start'

Definition at line 104 of file Text.d.

References memchr().

int indexOf char[]  source,
char[]  match
[inline, static]
 

Return the index of the first instance of 'match'

Definition at line 121 of file Text.d.

References indexOf().

int indexOf char[]  source,
char[]  match,
int  start
[inline, static]
 

Return the index of the first instance of 'match', starting at position 'start'

Definition at line 133 of file Text.d.

References indexOf().

char [] trim char[]  source  )  [inline, static]
 

Trim the provided string by stripping whitespace from both ends. Returns a slice of the original content.

Definition at line 157 of file Text.d.

int atoi char[]  digits  )  [inline, static]
 

Convert a string into a base-10 number.

Definition at line 183 of file Text.d.

int atoi char[]  digits,
int  radix
[inline, static]
 

Convert a string into a base-X number where X is specified by 'radix'

Definition at line 195 of file Text.d.

References Exception.

char [] itoa char[]  s,
long  i
[inline, static]
 

Convert an integer to a string, without allocating space.

Definition at line 225 of file Text.d.

Referenced by toString().

char [] toString int  i  )  [inline, static]
 

Convert an integer to a string

Definition at line 244 of file Text.d.

References itoa().

long atod char[]  date  )  [inline, static]
 

Convert a string to a date. This is just a symmetrical wrapper around the Phobos functionality.

Definition at line 258 of file Text.d.

References date.

char [] dtoa char[]  buffer,
long  time
[inline, static]
 

Shamelessly plundered from std.date (with permission), this version avoids allocating memory.

Returns a populated slice of the provided buffer; with zero length if the date was invalid.

Definition at line 273 of file Text.d.

References time.

char [] tolower inout char[]  src  )  [inline, static]
 

in-place conversion to lowercase

Definition at line 321 of file Text.d.


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:11 2004 for Mango by doxygen 1.3.6