Qore Programming Language Reference Manual  0.9.4.1
ql_string.dox.h
1 
3 namespace Qore {
190 
218 int bindex(softstring str, softstring substr, softint pos = 0);
219 
221 
225 int bindex();
226 
228 
255 int brindex(softstring str, softstring substr, softint pos = -1);
256 
258 
262 int brindex();
263 
265 
288 int char_width(softstring str);
289 
291 
307 string chomp(string str);
308 
310 
321 *string chomp(reference<string> str);
322 
324 
328 nothing chomp();
329 
331 
346 string chr(softint val, *string encoding);
347 
349 
354 string chr(auto arg);
355 
357 
361 nothing chr();
362 
364 
379 string convert_encoding(string str, string encoding);
380 
382 
386 nothing convert_encoding();
387 
389 
408 string f_printf(string fmt, ...);
409 
411 
415 string f_printf();
416 
418 
437 string f_sprintf(string fmt, ...);
438 
440 
444 string f_sprintf();
445 
447 
468 string f_vprintf(string fmt, auto varg);
469 
471 
492 string f_vsprintf(string fmt, auto varg);
493 
495 
503 nothing flush();
504 
506 
521 string force_encoding(string str, string encoding);
522 
524 
528 nothing force_encoding();
529 
531 
550 string format_number(string fmt, softfloat num);
551 
553 
557 nothing format_number();
558 
560 
574 string get_encoding(string str);
575 
577 
581 nothing get_encoding();
582 
584 
613 int index(softstring str, softstring substr, softint pos = 0);
614 
616 
620 int index();
621 
623 
638 string join(string str, ...);
639 
641 
658 string join(string str, list<auto> l);
659 
661 
665 nothing join();
666 
668 
691 int length(softstring str);
692 
694 
708 int length(binary bin);
709 
711 
715 nothing length();
716 
718 
722 int length(auto arg);
723 
725 
741 string ltrim(string str, *string chars);
742 
744 
758 *string ltrim(reference<string> str, *string chars);
759 
761 
776 int ord(softstring str, softint offset = 0);
777 
779 
783 int ord();
784 
786 
800 bool parse_boolean(string str);
801 
803 
815 bool parse_boolean(any val);
816 
818 
837 float parse_float(string str, string fmt);
838 
840 
859 int parse_int(string str, string fmt);
860 
862 
881 number parse_number(string str, string fmt);
882 
884 
896 nothing print( ...);
897 
899 
918 string printf(string fmt, ...);
919 
921 
928 string printf();
929 
931 
955 bool regex(string str, string regex, int options = 0);
956 
958 
962 nothing regex();
963 
965 
991 *list<*string> regex_extract(string str, string regex, int options = 0);
992 
994 
998 nothing regex_extract();
999 
1001 
1040 string regex_subst(string str, string regex, string subst, int options = 0);
1041 
1043 
1047 nothing regex_subst();
1048 
1050 
1078 string replace(string str, string source, string target, int start = 0, int end = -1);
1079 
1081 
1085 nothing replace();
1086 
1088 
1104 string reverse(softstring str);
1105 
1107 
1136 int rindex(softstring str, softstring substr, softint pos = -1);
1137 
1139 
1143 int rindex();
1144 
1146 
1164 string rtrim(string str, *string chars);
1165 
1167 
1183 *string rtrim(reference<string> str, *string chars);
1184 
1186 
1204 list<string> split(string sep, string str, bool with_separator = False);
1205 
1207 
1242 list<string> split(string sep, string str, string quote, bool trim_unquoted = False);
1243 
1245 
1260 list<binary> split(data sep, binary data);
1261 
1263 
1267 list<string> split();
1268 
1270 
1289 string sprintf(string fmt, ...);
1290 
1292 
1296 string sprintf();
1297 
1299 
1319 int strlen(softstring str);
1320 
1322 
1326 nothing strlen();
1327 
1329 
1333 int strlen(auto arg);
1334 
1336 
1350 string strmul(softstring str, softint smul, *softint offset);
1351 
1353 
1373 string substr(softstring str, softint start);
1374 
1376 
1397 string substr(softstring str, softint start, softint len);
1398 
1400 
1420 binary substr(binary b, softint start);
1421 
1423 
1444 binary substr(binary b, softint start, softint len);
1445 
1447 
1451 nothing substr();
1452 
1454 
1478 string tolower(string str);
1479 
1481 
1485 nothing tolower();
1486 
1488 
1512 string toupper(string str);
1513 
1515 
1519 nothing toupper();
1520 
1522 
1537 string trim(string str, *string chars);
1538 
1540 
1554 *string trim(reference<string> str, *string chars);
1555 
1557 
1561 nothing trim();
1562 
1564 
1580 string trunc_str(softstring str, softint len, *string encoding);
1581 
1583 
1602 string vprintf(string fmt, auto varg);
1603 
1605 
1609 string vprintf();
1610 
1612 
1631 string vsprintf(string fmt, auto varg);
1632 
1634 
1638 string vsprintf();
1639 
1641 }
1642 
1644 namespace Qore {
1651  const RE_Caseless = PCRE_CASELESS;
1654  const RE_DotAll = PCRE_DOTALL;
1656  const RE_Extended = PCRE_EXTENDED;
1658  const RE_Global = QRE_GLOBAL;
1660  const RE_MultiLine = PCRE_MULTILINE;
1662 
1664  const RE_Unicode = PCRE_UCP;
1666 }
Qore::tolower
string tolower(string str)
Returns a string in all lower-case characters based on the argument passed.
Qore::f_sprintf
string f_sprintf(string fmt,...)
Returns a formatted string based on a format string and other arguments; enforces field widths on arg...
Qore::index
int index(softstring str, softstring substr, softint pos=0)
Retrieves the character position of a substring within a string.
Qore::f_printf
string f_printf(string fmt,...)
Outputs the string passed to standard output, using the first argument as a format string; enforces f...
Qore::parse_int
int parse_int(string str, string fmt)
returns an integer corresponding to a string representing the number and an argument giving the forma...
Qore::strmul
string strmul(softstring str, softint smul, *softint offset)
Returns a new string with a repeated string element and optionally removing trailing characters.
Qore::reverse
nothing reverse()
This function variant does nothing at all; it is only included for backwards-compatibility with qore ...
Qore::substr
string substr(softstring str, softint start)
Returns a portion of a string starting from an integer offset.
Qore::ltrim
string ltrim(string str, *string chars)
Removes byte characters from the start of a string and returns the new string.
Qore::replace
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.
Qore::vprintf
string vprintf(string fmt, auto varg)
Outputs the string passed to standard output, using the first argument as a format string and a secon...
Qore::regex_extract
*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.
Qore::vsprintf
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...
Qore::split
list< string > split(string sep, string str, bool with_separator=False)
Splits a string into a list of components based on a separator string.
Qore::RE_DotAll
const RE_DotAll
makes a dot (.) match a newline character, equivalent to /s
Definition: ql_string.dox.h:1654
Qore::char_width
int char_width(softstring str)
Returns the width of characters in the string; some unicode characters take up multiple spaces on out...
Qore::RE_Extended
const RE_Extended
ignores whitespace characters and enables comments prefixed by #, equivalent to /x
Definition: ql_string.dox.h:1656
Qore::format_number
string format_number(string fmt, softfloat num)
Returns a string of a formatted number according to a number argument and a format string.
Qore::parse_float
float parse_float(string str, string fmt)
returns a floating-point value corresponding to a string representing the number and an argument givi...
Qore::RE_Caseless
const RE_Caseless
Ignores case when matching regular expressions, equivalent to /i
Definition: ql_string.dox.h:1652
Qore::bindex
int bindex(softstring str, softstring substr, softint pos=0)
Retrieves the byte position of a substring within a string.
Qore::chr
string chr(softint val, *string encoding)
Returns a string containing a single ASCII character represented by the numeric value passed.
Qore::brindex
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...
Qore::length
int length(softstring str)
Returns the length in characters for the string passed.
Qore::regex_subst
string regex_subst(string str, string regex, string subst, int options=0)
Returns a string with patterns substituted according to the arguments passed.
Qore::chomp
string chomp(string str)
Removes the trailing end-of-line indicator ("\n" or "\r\n") from a string and returns the new string ...
Qore::f_vsprintf
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...
Qore::trim
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...
Qore::rindex
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 ...
Qore::parse_boolean
bool parse_boolean(string str)
tries to parse a string value as a boolean
Qore::parse_number
number parse_number(string str, string fmt)
returns a number corresponding to the string and the argument, giving the format
Qore::RE_Unicode
const RE_Unicode
extens Posix matches to the full Unicode character set
Definition: ql_string.dox.h:1664
Qore::f_vprintf
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...
Qore::trunc_str
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 ...
Qore::regex
bool regex(string str, string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False.
Qore::print
nothing print(...)
Outputs a string to standard output with no formatting.
Qore::sprintf
string sprintf(string fmt,...)
Returns a formatted string based on a format string and other arguments; does not enforce field width...
Qore::join
string join(string str,...)
Creates a string from separator string and a list of arguments.
Qore::False
const False
logical False
Definition: qc_qore.dox.h:96
Qore::rtrim
string rtrim(string str, *string chars)
Removes byte characters from the end of a string and returns the new string.
Qore::get_encoding
string get_encoding(string str)
Returns a string describing the character encoding of the string argument passed.
Qore::RE_Global
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
Qore::number
number number(softnumber n)
Converts the argument to a number value.
Qore::printf
string printf(string fmt,...)
Outputs the string passed to standard output, using the first argument as a format string; does not e...
Qore::flush
nothing flush()
Flushes output to the console output with print(), printf(), etc.
Qore::ord
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...
Qore::force_encoding
string force_encoding(string str, string encoding)
Returns the first string argument tagged with the character encoding given as the second argument; do...
Qore
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
Qore::strlen
int strlen(softstring str)
Returns the length in bytes of the string argument.
Qore::toupper
string toupper(string str)
Returns a string in all upper-case characters based on the argument passed.
Qore::RE_MultiLine
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
Qore::convert_encoding
string convert_encoding(string str, string encoding)
Performs explicit string character encoding conversions.
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)