Joergen Ibsen
312bc2ca81
Fix string format recursive replace
...
Also error on placeholder index out of range.
7 years ago
Joergen Ibsen
dad5779d3c
Add test for five escapes before n
7 years ago
Joergen Ibsen
b9a0589067
Fix escaping of newlines in string literals
...
Replace '\n' escape sequence before '\\' to allow a literal backslash
to be inserted before the character 'n'.
Fixes #2682
7 years ago
Nirbheek Chauhan
276e9c15cc
str.split() can now take a positional argument
...
All the specified characters in the specified argument will be
stripped. If unspecified, the old behaviour is used.
Includes tests.
7 years ago
Jussi Pakkanen
b5013a573a
Added semantic versioning comparison method to strings.
9 years ago
Jussi Pakkanen
2a3a1ce8e0
Join() convenience method for strings. Closes #552 .
9 years ago
Tim-Philipp Müller
3eea1703ff
Add bool to_string() and to_int() methods
...
bool to_int() will return 0 or 1, useful if one wants to set
a define to 0 or 1 based on a boolean result instead of having
it just defined or undefined.
bool to_string() will return 'true' or 'false' by default same
as when using it to format a string, but with the additional
possibility to specify two extra string arguments to be returned
as true/false values, e.g. to_string('yes', 'no'). This can be
useful when outputting messages to be shown to the user.
9 years ago
Jussi Pakkanen
f3e20b2570
Use assert instead of if/error.
9 years ago
Tim-Philipp Müller
3c8468cd4d
Add string underscorify() function
...
So we can easily construct the defines for include headers and
struct checks and such.
9 years ago
Tim-Philipp Müller
02e84df010
Add more string functions: contains(), to_upper() and to_lower()
9 years ago
Jussi Pakkanen
0c96dbff3a
String to int conversion. Closes #362 .
9 years ago
Jussi Pakkanen
df979ad422
String startswith and endswith methods.
9 years ago
Jussi Pakkanen
08d18671ae
Better.
12 years ago
Jussi Pakkanen
3b4e77a658
String formatting functionality.
12 years ago