Text Class Reference
[System]
Utility for working with text and strings.
More...
#include <Text.hpp>
List of all members.
Static Public Member Functions |
static int | count (const string &text, char character) |
static bool | endsWith (const string &text, char character) |
static int | findFirstNotWordCharacter (const string &text, int pos=0) |
static pair< int, int > | findFirstWord (const string &text, int pos=0) |
static int | findFirstWordCharacter (const string &text, int pos=0) |
static string | indent (int times) |
static string | replace (const string &text, map< string, string > &dictionary) |
static pair< string, string > | split (const string &text, char at) |
static string | toLower (string txt) |
static string | trim (const string &text, const string &characters=" ") |
Detailed Description
Utility for working with text and strings.
Member Function Documentation
int count |
( |
const string & |
text, |
|
|
char |
character | |
|
) |
| | [static] |
- Returns:
- Number of occurrences of character in text.
bool endsWith |
( |
const string & |
text, |
|
|
char |
character | |
|
) |
| | [static] |
- Returns:
- True if character is at the last position of text.
int findFirstNotWordCharacter |
( |
const string & |
text, |
|
|
int |
pos = 0 | |
|
) |
| | [static] |
- Returns:
- Position of first character in text that cannot be part of a word.
- Parameters:
-
| text | String to search |
| pos | Position to start from |
pair< int, int > findFirstWord |
( |
const string & |
text, |
|
|
int |
pos = 0 | |
|
) |
| | [static] |
- Returns:
- Start of the first word and its length.
- Parameters:
-
| text | String to search |
| pos | Position to search from |
int findFirstWordCharacter |
( |
const string & |
text, |
|
|
int |
pos = 0 | |
|
) |
| | [static] |
- Returns:
- Position of first character in text that can be part of a word.
- Parameters:
-
| text | String to search |
| pos | Position to start from |
string indent |
( |
int |
times |
) |
[static] |
- Returns:
- String with times * 2 spaces.
string replace |
( |
const string & |
text, |
|
|
map< string, string > & |
dictionary | |
|
) |
| | [static] |
- Returns:
- Copy of text with keys in dictionary replaced with values.
pair< string, string > split |
( |
const string & |
text, |
|
|
char |
at | |
|
) |
| | [static] |
- Returns:
- Pair of strings before and after the first occurence of at.
string toLower |
( |
string |
text |
) |
[static] |
- Returns:
- String with each character in text converted to lowercase.
string trim |
( |
const string & |
text, |
|
|
const string & |
characters = " " | |
|
) |
| | [static] |
- Returns:
- Copy of text with characters removed from start and end.
The documentation for this class was generated from the following files: