SimpleCxxLib
package#include "strlib.h"
Functions | |
Returns true if the string str ends with the specified suffix, which may be either a string or a character. | |
Returns true if s1 and s2 are equal discounting differences in case. | |
Converts an integer into the corresponding string of digits. | |
Converts a floating-point number into the corresponding string form. | |
Returns true if the string str starts with the specified prefix, which may be either a string or a character. | |
Converts a string of digits into an integer. | |
Converts a string representing a real number into its corresponding value. | |
Returns a new string in which all uppercase characters have been converted into their lowercase equivalents. | |
Returns a new string in which all lowercase characters have been converted into their uppercase equivalents. | |
Returns a new string after removing any whitespace characters from the beginning and end of the argument. |
string integerToString(int n);
integerToString(123)
returns
the string "123"
.
Usage:
string s = integerToString(n);
int stringToInteger(string str);
stringToInteger
calls error
with an
appropriate message.
Usage:
int n = stringToInteger(str);
string realToString(double d);
realToString(23.45)
returns
the string "23.45"
.
Usage:
string s = realToString(d);
double stringToReal(string str);
stringToReal
calls error
with an appropriate message.
Usage:
double d = stringToReal(str);
string toUpperCase(string str);
Usage:
string s = toUpperCase(str);
string toLowerCase(string str);
Usage:
string s = toLowerCase(str);
bool equalsIgnoreCase(string s1, string s2);
true
if s1
and s2
are
equal discounting differences in case.
Usage:
if (equalsIgnoreCase(s1, s2)) ...
bool startsWith(string str, string prefix); bool startsWith(string str, char prefix);
true
if the string str
starts with
the specified prefix, which may be either a string or a character.
Usage:
if (startsWith(str, prefix)) ...
bool endsWith(string str, string suffix); bool endsWith(string str, char suffix);
true
if the string str
ends with
the specified suffix, which may be either a string or a character.
Usage:
if (endsWith(str, suffix)) ...
string trim(string str);
Usage:
string trimmed = trim(str);