Qore Programming Language Reference Manual 1.12.3
Loading...
Searching...
No Matches
ql_string.dox.h
1
3namespace Qore {
191
194
221int bindex(softstring str, softstring substr, softint pos = 0);
222
224
228int bindex();
229
231
258int brindex(softstring str, softstring substr, softint pos = -1);
259
261
266
268
291int char_width(softstring str);
292
294
310string chomp(string str);
311
313
324*string chomp(reference<string> str);
325
327
331nothing chomp();
332
334
349string chr(softint val, *string encoding);
350
352
357string chr(auto arg);
358
360
364nothing chr();
365
367
382string convert_encoding(string str, string encoding);
383
385
390
392
411string f_printf(string fmt, ...);
412
414
418string f_printf();
419
421
440string f_sprintf(string fmt, ...);
441
443
447string f_sprintf();
448
450
471string f_vprintf(string fmt, auto varg);
472
474
495string f_vsprintf(string fmt, auto varg);
496
498
506nothing flush();
507
509
524string force_encoding(string str, string encoding);
525
527
532
534
553string format_number(string fmt, softfloat num);
554
556
561
563
577string get_encoding(string str);
578
580
584nothing get_encoding();
585
587
616int index(softstring str, softstring substr, softint pos = 0);
617
619
623int index();
624
626
641string join(string str, ...);
642
644
661string join(string str, list<auto> l);
662
664
668nothing join();
669
671
694int length(softstring str);
695
697
711int length(binary bin);
712
714
718nothing length();
719
721
725int length(auto arg);
726
728
744string ltrim(string str, *string chars);
745
747
761*string ltrim(reference<string> str, *string chars);
762
764
779int ord(softstring str, softint offset = 0);
780
782
786int ord();
787
789
803bool parse_boolean(string str);
804
806
818bool parse_boolean(any val);
819
821
840float parse_float(string str, string fmt);
841
843
862int parse_int(string str, string fmt);
863
865
884number parse_number(string str, string fmt);
885
887
899nothing print( ...);
900
902
921string printf(string fmt, ...);
922
924
931string printf();
932
934
958bool regex(string str, string regex, int options = 0);
959
961
965nothing regex();
966
968
994*list<*string> regex_extract(string str, string regex, int options = 0);
995
997
1002
1004
1043string regex_subst(string str, string regex, string subst, int options = 0);
1044
1046
1050nothing regex_subst();
1051
1053
1081string replace(string str, string source, string target, int start = 0, int end = -1);
1082
1084
1088nothing replace();
1089
1091
1107string reverse(softstring str);
1108
1110
1139int rindex(softstring str, softstring substr, softint pos = -1);
1140
1142
1147
1149
1167string rtrim(string str, *string chars);
1168
1170
1186*string rtrim(reference<string> str, *string chars);
1187
1189
1213list<string> split(string sep, string str, bool with_separator = False);
1214
1216
1251list<string> split(string sep, string str, string quote, bool trim_unquoted = False);
1252
1254
1269list<binary> split(data sep, binary data);
1270
1272
1276list<string> split();
1277
1279
1298string sprintf(string fmt, ...);
1299
1301
1305string sprintf();
1306
1308
1328int strlen(softstring str);
1329
1331
1335nothing strlen();
1336
1338
1342int strlen(auto arg);
1343
1345
1359string strmul(softstring str, softint smul, *softint offset);
1360
1362
1382string substr(softstring str, softint start);
1383
1385
1406string substr(softstring str, softint start, softint len);
1407
1409
1429binary substr(binary b, softint start);
1430
1432
1453binary substr(binary b, softint start, softint len);
1454
1456
1460nothing substr();
1461
1463
1487string tolower(string str);
1488
1490
1494nothing tolower();
1495
1497
1521string toupper(string str);
1522
1524
1528nothing toupper();
1529
1531
1546string trim(string str, *string chars);
1547
1549
1563*string trim(reference<string> str, *string chars);
1564
1566
1570nothing trim();
1571
1573
1589string trunc_str(softstring str, softint len, *string encoding);
1590
1592
1611string vprintf(string fmt, auto varg);
1612
1614
1618string vprintf();
1619
1621
1640string vsprintf(string fmt, auto varg);
1641
1643
1647string vsprintf();
1648
1650}
1651
1653namespace Qore {
1658
1661 const RE_Caseless = PCRE_CASELESS;
1663 const RE_DotAll = PCRE_DOTALL;
1665 const RE_Extended = PCRE_EXTENDED;
1667 const RE_Global = QRE_GLOBAL;
1669 const RE_MultiLine = PCRE_MULTILINE;
1671
1673 const RE_Unicode = PCRE_UCP;
1675}
const False
logical False
Definition: qc_qore.dox.h:96
nothing reverse()
This function variant does nothing at all.
const RE_DotAll
makes a dot (.) match a newline character, equivalent to /s
Definition: ql_string.dox.h:1663
const RE_Unicode
extens Posix matches to the full Unicode character set
Definition: ql_string.dox.h:1673
const RE_Extended
ignores whitespace characters and enables comments prefixed by #, equivalent to /x
Definition: ql_string.dox.h:1665
const RE_Caseless
Ignores case when matching regular expressions, equivalent to /i
Definition: ql_string.dox.h:1661
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:1669
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:1667
number parse_number(string str, string fmt)
returns a number corresponding to the string and the argument, giving the format
nothing replace()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
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 rtrim(string str, *string chars)
Removes byte characters from the end of a string and returns the new string.
string vprintf()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing chomp()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing regex_extract()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
int rindex()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing strlen()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
int char_width(softstring str)
Returns the width of characters in the string; some unicode characters take up multiple spaces on out...
nothing length()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
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 ...
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 f_sprintf()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing flush()
Flushes output to the console output with print(), printf(), etc.
nothing chr()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing substr()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
string f_printf()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
bool parse_boolean(string str)
tries to parse a string value as a boolean
nothing get_encoding()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing toupper()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing join()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing print(...)
Outputs a string to standard output with no formatting.
nothing format_number()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
int brindex()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
string ltrim(string str, *string chars)
Removes byte characters from the start of a string and returns the new string.
string strmul(softstring str, softint smul, *softint offset)
Returns a new string with a repeated string element and optionally removing trailing characters.
string sprintf()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
int bindex()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing force_encoding()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing regex_subst()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing convert_encoding()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing regex()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
int index()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
string vsprintf()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
int ord()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
list< string > split()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
int parse_int(string str, string fmt)
returns an integer corresponding to a string representing the number and an argument giving the forma...
float parse_float(string str, string fmt)
returns a floating-point value corresponding to a string representing the number and an argument givi...
nothing tolower()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
string printf()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
nothing trim()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
number number()
Always returns 0.0.
binary binary()
Always returns an empty binary object (of zero length)
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:3