 |
Qore Programming Language Reference Manual
0.9.4.2
|
218 int bindex(softstring str, softstring
substr, softint pos = 0);
255 int brindex(softstring str, softstring
substr, softint pos = -1);
307 string chomp(
string str);
321 *
string chomp(reference<string> str);
346 string chr(softint val, *
string encoding);
354 string chr(
auto arg);
613 int index(softstring str, softstring
substr, softint pos = 0);
638 string join(
string str, ...);
658 string join(
string str, list<auto> l);
691 int length(softstring str);
741 string ltrim(
string str, *
string chars);
758 *
string ltrim(reference<string> str, *
string chars);
776 int ord(softstring str, softint offset = 0);
918 string printf(
string fmt, ...);
955 bool regex(
string str,
string regex,
int options = 0);
1040 string regex_subst(
string str,
string regex,
string subst,
int options = 0);
1078 string replace(
string str,
string source,
string target,
int start = 0,
int end = -1);
1104 string reverse(softstring str);
1136 int rindex(softstring str, softstring
substr, softint pos = -1);
1164 string rtrim(
string str, *
string chars);
1183 *
string rtrim(reference<string> str, *
string chars);
1204 list<string>
split(
string sep,
string str,
bool with_separator =
False);
1242 list<string>
split(
string sep,
string str,
string quote,
bool trim_unquoted =
False);
1267 list<string>
split();
1289 string sprintf(
string fmt, ...);
1319 int strlen(softstring str);
1350 string strmul(softstring str, softint smul, *softint offset);
1373 string substr(softstring str, softint start);
1397 string substr(softstring str, softint start, softint len);
1537 string trim(
string str, *
string chars);
1554 *
string trim(reference<string> str, *
string chars);
1580 string trunc_str(softstring str, softint len, *
string encoding);
1602 string vprintf(
string fmt,
auto varg);
1631 string vsprintf(
string fmt,
auto varg);
string tolower(string str)
Returns a string in all lower-case characters based on the argument passed.
string f_sprintf(string fmt,...)
Returns a formatted string based on a format string and other arguments; enforces field widths on arg...
int index(softstring str, softstring substr, softint pos=0)
Retrieves the character position of a substring within a string.
string f_printf(string fmt,...)
Outputs the string passed to standard output, using the first argument as a format string; enforces f...
int parse_int(string str, string fmt)
returns an integer corresponding to a string representing the number and an argument giving the forma...
string strmul(softstring str, softint smul, *softint offset)
Returns a new string with a repeated string element and optionally removing trailing characters.
nothing reverse()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
string substr(softstring str, softint start)
Returns a portion of a string starting from an integer offset.
string ltrim(string str, *string chars)
Removes byte characters from the start of a string and returns the new string.
string replace(string str, string source, string target, int start=0, int end=-1)
Replaces all occurrences of a substring in a string with another string.
string vprintf(string fmt, auto varg)
Outputs the string passed to standard output, using the first argument as a format string and a secon...
*list< *string > regex_extract(string str, string regex, int options=0)
Returns a list of substrings in a string based on matching patterns defined by a regular expression.
string vsprintf(string fmt, auto varg)
Returns a formatted string based on a format string and other arguments given as a list after the for...
list< string > split(string sep, string str, bool with_separator=False)
Splits a string into a list of components based on a separator string.
const RE_DotAll
makes a dot (.) match a newline character, equivalent to /s
Definition: ql_string.dox.h:1654
int char_width(softstring str)
Returns the width of characters in the string; some unicode characters take up multiple spaces on out...
const RE_Extended
ignores whitespace characters and enables comments prefixed by #, equivalent to /x
Definition: ql_string.dox.h:1656
string format_number(string fmt, softfloat num)
Returns a string of a formatted number according to a number argument and a format string.
float parse_float(string str, string fmt)
returns a floating-point value corresponding to a string representing the number and an argument givi...
const RE_Caseless
Ignores case when matching regular expressions, equivalent to /i
Definition: ql_string.dox.h:1652
int bindex(softstring str, softstring substr, softint pos=0)
Retrieves the byte position of a substring within a string.
string chr(softint val, *string encoding)
Returns a string containing a single ASCII character represented by the numeric value passed.
int brindex(softstring str, softstring substr, softint pos=-1)
Retrieves the byte position of a substring within a string, starting the search from the end of the s...
int length(softstring str)
Returns the length in characters for the string passed.
string regex_subst(string str, string regex, string subst, int options=0)
Returns a string with patterns substituted according to the arguments passed.
string chomp(string str)
Removes the trailing end-of-line indicator ("\n" or "\r\n") from a string and returns the new string ...
string f_vsprintf(string fmt, auto varg)
Returns a formatted string based on a format string and other arguments given as a list after the for...
string trim(string str, *string chars)
Removes byte characters from the start and end of a string and returns the new string (also see the t...
int rindex(softstring str, softstring substr, softint pos=-1)
Retrieves the character position of a substring within a string, starting the search from the end of ...
bool parse_boolean(string str)
tries to parse a string value as a boolean
number parse_number(string str, string fmt)
returns a number corresponding to the string and the argument, giving the format
const RE_Unicode
extens Posix matches to the full Unicode character set
Definition: ql_string.dox.h:1664
string f_vprintf(string fmt, auto varg)
Outputs the string passed to standard output, using the first argument as a format string and a secon...
string trunc_str(softstring str, softint len, *string encoding)
Returns a truncated string with no more than the given number of bytes and optionally converted to a ...
bool regex(string str, string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False.
nothing print(...)
Outputs a string to standard output with no formatting.
string sprintf(string fmt,...)
Returns a formatted string based on a format string and other arguments; does not enforce field width...
string join(string str,...)
Creates a string from separator string and a list of arguments.
const False
logical False
Definition: qc_qore.dox.h:96
string rtrim(string str, *string chars)
Removes byte characters from the end of a string and returns the new string.
string get_encoding(string str)
Returns a string describing the character encoding of the string argument passed.
const RE_Global
replace all matches globally in the string or extract all occurrences of the pattern(s) in the string...
Definition: ql_string.dox.h:1658
number number(softnumber n)
Converts the argument to a number value.
string printf(string fmt,...)
Outputs the string passed to standard output, using the first argument as a format string; does not e...
nothing flush()
Flushes output to the console output with print(), printf(), etc.
int ord(softstring str, softint offset=0)
Gives the positive numeric value of the given byte in the string passed; if no string is passed or th...
string force_encoding(string str, string encoding)
Returns the first string argument tagged with the character encoding given as the second argument; do...
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3
int strlen(softstring str)
Returns the length in bytes of the string argument.
string toupper(string str)
Returns a string in all upper-case characters based on the argument passed.
const RE_MultiLine
makes start-of-line (^) or end-of-line ($) match after or before any newline in the subject string,...
Definition: ql_string.dox.h:1660
string convert_encoding(string str, string encoding)
Performs explicit string character encoding conversions.
binary binary()
Always returns an empty binary object (of zero length)