Qore Programming Language Reference Manual  0.8.9
 All Classes Namespaces Functions Variables Groups Pages
ql_string.dox.h
1 
3 namespace Qore {
149 
151 
178 int bindex(softstring str, softstring substr, softint pos = 0);
179 
181 
185 int bindex();
186 
188 
215 int brindex(softstring str, softstring substr, softint pos = -1);
216 
218 
222 int brindex();
223 
225 
241 string chomp(string str);
242 
244 
255 *string chomp(reference str);
256 
258 
262 nothing chomp();
263 
265 
280 string chr(softint val, *string encoding);
281 
283 
288 string chr(any arg);
289 
291 
295 nothing chr();
296 
298 
313 string convert_encoding(string str, string encoding);
314 
316 
320 nothing convert_encoding();
321 
323 
342 string f_printf(string fmt, ...);
343 
345 
349 string f_printf();
350 
352 
371 string f_sprintf(string fmt, ...);
372 
374 
378 string f_sprintf();
379 
381 
402 string f_vprintf(string fmt, any varg);
403 
405 
426 string f_vsprintf(string fmt, any varg);
427 
429 
437 nothing flush();
438 
440 
455 string force_encoding(string str, string encoding);
456 
458 
462 nothing force_encoding();
463 
465 
484 string format_number(string fmt, softfloat num);
485 
487 
491 nothing format_number();
492 
494 
508 string get_encoding(string str);
509 
511 
515 nothing get_encoding();
516 
518 
547 int index(softstring str, softstring substr, softint pos = 0);
548 
550 
554 int index();
555 
557 
572 string join(string str, ...);
573 
575 
592 string join(string str, list l);
593 
595 
599 nothing join();
600 
602 
625 int length(softstring str);
626 
628 
642 int length(binary bin);
643 
645 
649 nothing length();
650 
652 
656 int length(any arg);
657 
659 
674 int ord(softstring str, softint offset = 0);
675 
677 
681 int ord();
682 
684 
696 bool parse_boolean(string str);
697 
699 
709 bool parse_boolean( ...);
710 
712 
724 nothing print( ...);
725 
727 
746 string printf(string fmt, ...);
747 
749 
756 string printf();
757 
759 
783 bool regex(string str, string regex, int options = 0);
784 
786 
790 nothing regex();
791 
793 
819 *list regex_extract(string str, string regex, int options = 0);
820 
822 
826 nothing regex_extract();
827 
829 
868 string regex_subst(string str, string regex, string subst, int options = 0);
869 
871 
875 nothing regex_subst();
876 
878 
900 string replace(string str, string source, string target, int start = 0, int end = -1);
901 
903 
907 nothing replace();
908 
910 
926 string reverse(softstring str);
927 
929 
958 int rindex(softstring str, softstring substr, softint pos = -1);
959 
961 
965 int rindex();
966 
968 
986 list split(string sep, string str, bool with_separator = False);
987 
989 
1013 list split(string sep, string str, string quote, bool trim_unquoted = False);
1014 
1016 
1031 list split(binary sep, binary data);
1032 
1034 
1038 list split();
1039 
1041 
1060 string sprintf(string fmt, ...);
1061 
1063 
1067 string sprintf();
1068 
1070 
1090 int strlen(softstring str);
1091 
1093 
1097 nothing strlen();
1098 
1100 
1104 int strlen(any arg);
1105 
1107 
1121 string strmul(softstring str, softint smul, *softint offset);
1122 
1124 
1144 string substr(softstring str, softint start);
1145 
1147 
1168 string substr(softstring str, softint start, softint len);
1169 
1171 
1191 binary substr(binary b, softint start);
1192 
1194 
1215 binary substr(binary b, softint start, softint len);
1216 
1218 
1222 nothing substr();
1223 
1225 
1249 string tolower(string str);
1250 
1252 
1256 nothing tolower();
1257 
1259 
1283 string toupper(string str);
1284 
1286 
1290 nothing toupper();
1291 
1293 
1310 string trim(string str, *string chars);
1311 
1313 
1329 *string trim(reference str, *string chars);
1330 
1332 
1336 nothing trim();
1337 
1339 
1355 string trunc_str(softstring str, softint len, *string encoding);
1356 
1358 
1377 string vprintf(string fmt, ...);
1378 
1380 
1384 string vprintf();
1385 
1387 
1406 string vsprintf(string fmt, any varg);
1407 
1409 
1413 string vsprintf();
1414 
1416 };
1417 
1419 namespace Qore {
1425 
1427  const RE_Caseless = PCRE_CASELESS;
1429  const RE_DotAll = PCRE_DOTALL;
1431  const RE_Extended = PCRE_EXTENDED;
1433  const RE_Global = QRE_GLOBAL;
1435  const RE_MultiLine = PCRE_MULTILINE;
1437 };
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.
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...
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.
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:1435
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 a 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 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...
const RE_Caseless
Ignores case when matching regular expressions, equivalent to /i
Definition: ql_string.dox.h:1427
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:1429
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.
list split(string sep, string str, bool with_separator=False)
Splits a string into a list of components based on a separator string.
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:1433
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 numeric value of the given byte in the string passed; if no string is passed or the offset ...
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...
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:1431
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 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...