Qore Programming Language Reference Manual  0.8.13.2
ql_string.dox.h
1 
3 namespace Qore {
175 
177 
204 int bindex(softstring str, softstring substr, softint pos = 0);
205 
207 
211 int bindex();
212 
214 
241 int brindex(softstring str, softstring substr, softint pos = -1);
242 
244 
248 int brindex();
249 
251 
267 string chomp(string str);
268 
270 
281 *string chomp(reference<string> str);
282 
284 
288 nothing chomp();
289 
291 
306 string chr(softint val, *string encoding);
307 
309 
314 string chr(any arg);
315 
317 
321 nothing chr();
322 
324 
339 string convert_encoding(string str, string encoding);
340 
342 
346 nothing convert_encoding();
347 
349 
368 string f_printf(string fmt, ...);
369 
371 
375 string f_printf();
376 
378 
397 string f_sprintf(string fmt, ...);
398 
400 
404 string f_sprintf();
405 
407 
428 string f_vprintf(string fmt, any varg);
429 
431 
452 string f_vsprintf(string fmt, any varg);
453 
455 
463 nothing flush();
464 
466 
481 string force_encoding(string str, string encoding);
482 
484 
488 nothing force_encoding();
489 
491 
510 string format_number(string fmt, softfloat num);
511 
513 
517 nothing format_number();
518 
520 
534 string get_encoding(string str);
535 
537 
541 nothing get_encoding();
542 
544 
573 int index(softstring str, softstring substr, softint pos = 0);
574 
576 
580 int index();
581 
583 
598 string join(string str, ...);
599 
601 
618 string join(string str, list l);
619 
621 
625 nothing join();
626 
628 
651 int length(softstring str);
652 
654 
668 int length(binary bin);
669 
671 
675 nothing length();
676 
678 
682 int length(any arg);
683 
685 
701 string ltrim(string str, *string chars);
702 
704 
718 *string ltrim(reference<string> str, *string chars);
719 
721 
736 int ord(softstring str, softint offset = 0);
737 
739 
743 int ord();
744 
746 
760 bool parse_boolean(string str);
761 
763 
775 bool parse_boolean(any val);
776 
778 
797 float parse_float(string str, string fmt);
798 
800 
819 int parse_int(string str, string fmt);
820 
822 
841 number parse_number(string str, string fmt);
842 
844 
856 nothing print( ...);
857 
859 
878 string printf(string fmt, ...);
879 
881 
888 string printf();
889 
891 
915 bool regex(string str, string regex, int options = 0);
916 
918 
922 nothing regex();
923 
925 
951 *list<string> regex_extract(string str, string regex, int options = 0);
952 
954 
958 nothing regex_extract();
959 
961 
1000 string regex_subst(string str, string regex, string subst, int options = 0);
1001 
1003 
1007 nothing regex_subst();
1008 
1010 
1032 string replace(string str, string source, string target, int start = 0, int end = -1);
1033 
1035 
1039 nothing replace();
1040 
1042 
1058 string reverse(softstring str);
1059 
1061 
1090 int rindex(softstring str, softstring substr, softint pos = -1);
1091 
1093 
1097 int rindex();
1098 
1100 
1118 string rtrim(string str, *string chars);
1119 
1121 
1137 *string rtrim(reference<string> str, *string chars);
1138 
1140 
1158 list<string> split(string sep, string str, bool with_separator = False);
1159 
1161 
1185 list<string> split(string sep, string str, string quote, bool trim_unquoted = False);
1186 
1188 
1203 list<string> split(binary sep, binary data);
1204 
1206 
1210 list<string> split();
1211 
1213 
1232 string sprintf(string fmt, ...);
1233 
1235 
1239 string sprintf();
1240 
1242 
1262 int strlen(softstring str);
1263 
1265 
1269 nothing strlen();
1270 
1272 
1276 int strlen(any arg);
1277 
1279 
1293 string strmul(softstring str, softint smul, *softint offset);
1294 
1296 
1316 string substr(softstring str, softint start);
1317 
1319 
1340 string substr(softstring str, softint start, softint len);
1341 
1343 
1363 binary substr(binary b, softint start);
1364 
1366 
1387 binary substr(binary b, softint start, softint len);
1388 
1390 
1394 nothing substr();
1395 
1397 
1421 string tolower(string str);
1422 
1424 
1428 nothing tolower();
1429 
1431 
1455 string toupper(string str);
1456 
1458 
1462 nothing toupper();
1463 
1465 
1480 string trim(string str, *string chars);
1481 
1483 
1497 *string trim(reference<string> str, *string chars);
1498 
1500 
1504 nothing trim();
1505 
1507 
1523 string trunc_str(softstring str, softint len, *string encoding);
1524 
1526 
1545 string vprintf(string fmt, ...);
1546 
1548 
1552 string vprintf();
1553 
1555 
1574 string vsprintf(string fmt, any varg);
1575 
1577 
1581 string vsprintf();
1582 
1584 };
1585 
1587 namespace Qore {
1593 
1595  const RE_Caseless = PCRE_CASELESS;
1597  const RE_DotAll = PCRE_DOTALL;
1599  const RE_Extended = PCRE_EXTENDED;
1601  const RE_Global = QRE_GLOBAL;
1603  const RE_MultiLine = PCRE_MULTILINE;
1605 };
*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 sprintf(string fmt,...)
Returns a formatted string based on a format string and other arguments; does not enforce field width...
string printf(string fmt,...)
Outputs the string passed to standard output, using the first argument as a format string; does not e...
string force_encoding(string str, string encoding)
Returns the first string argument tagged with the character encoding given as the second argument; do...
int strlen(softstring str)
Returns the length in bytes of the string argument.
string rtrim(string str, *string chars)
Removes byte characters from the end of a string and returns the new string.
bool parse_boolean(string str)
tries to parse a string value as a boolean
string get_encoding(string str)
Returns a string describing the character encoding of the string argument passed. ...
string format_number(string fmt, softfloat num)
Returns a string of a formatted number according to a number argument and a format string...
number parse_number(string str, string fmt)
returns a number corresponding to the string and the argument, giving the format
int bindex(softstring str, softstring substr, softint pos=0)
Retrieves the byte position of a substring within a string.
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...
nothing flush()
Flushes output to the console output with print(), printf(), etc.
number number(softnumber n)
Converts the argument to a number value.
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:1603
binary binary()
Always returns an empty binary object (of zero length)
string substr(softstring str, softint start)
Returns a portion of a string starting from an integer offset.
string chomp(string str)
Removes the trailing end-of-line indicator ("\n" or "\r\n") from a string and returns the new string ...
const False
logical False
Definition: qc_qore.dox.h:92
nothing print(...)
Outputs a string to standard output with no formatting.
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.
list list(...)
Returns an untyped list of the arguments passed at the top level.
int index(softstring str, softstring substr, softint pos=0)
Retrieves the character position of a substring within a string.
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_Caseless
Ignores case when matching regular expressions, equivalent to /i
Definition: ql_string.dox.h:1595
bool regex(string str, string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False...
const RE_DotAll
makes a dot (.) match a newline character, equivalent to /s
Definition: ql_string.dox.h:1597
string f_vsprintf(string fmt, any varg)
Returns a formatted string based on a format string and other arguments given as a list after the for...
string vprintf(string fmt,...)
Outputs the string passed to standard output, using the first argument as a format string and a secon...
string strmul(softstring str, softint smul, *softint offset)
Returns a new string with a repeated string element and optionally removing trailing characters...
string chr(softint val, *string encoding)
Returns a string containing a single ASCII character represented by the numeric value passed...
string convert_encoding(string str, string encoding)
Performs explicit string character encoding conversions.
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:1601
string tolower(string str)
Returns a string in all lower-case characters based on the argument passed.
string toupper(string str)
Returns a string in all upper-case characters based on the argument passed.
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 f_vprintf(string fmt, any varg)
Outputs the string passed to standard output, using the first argument as a format string and a secon...
string regex_subst(string str, string regex, string subst, int options=0)
Returns a string with patterns substituted according to the arguments passed.
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 ...
string f_sprintf(string fmt,...)
Returns a formatted string based on a format string and other arguments; enforces field widths on arg...
float parse_float(string str, string fmt)
returns a floating-point value corresponding to a string representing the number and an argument givi...
int parse_int(string str, string fmt)
returns an integer corresponding to a string representing the number and an argument giving the forma...
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 ...
const RE_Extended
ignores whitespace characters and enables comments prefixed by #, equivalent to /x ...
Definition: ql_string.dox.h:1599
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...
string vsprintf(string fmt, any varg)
Returns a formatted string based on a format string and other arguments given as a list after the for...
int length(softstring str)
Returns the length in characters for the string passed.
string ltrim(string str, *string chars)
Removes byte characters from the start of a string and returns the new string.
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
string join(string str,...)
Creates a string from separator string and a list of arguments.
nothing reverse()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
string f_printf(string fmt,...)
Outputs the string passed to standard output, using the first argument as a format string; enforces f...