DISCLOSE
s = DISCLOSE (str [, pairs [, ignore-pairs]])
Discloses the string str
. pairs
is a string
of 2n characters. Two consecutive characters form a pair. The characters
of str
which are positioned between the first matching pair
of pairs
will be returned. ignore-pairs
is a
string with 2n characters. Two consecutive characters form a
ignore-pair. All characters of str
between an ignore-pair
will be ignored (not returned).
if pairs
and ingnore-pairs
are not given,
the following default pairs and ignore pairs will be used:
First non white-space character | Check | Ignore |
---|---|---|
” | ” ” | ’ ’ |
’ | ’ ’ | ” ” |
( | () | ” ” ’ ’ |
[ | [] | ” ” ’ ’ |
{ | {} | ” ” ’ ’ |
< | <> | ” ” ’ ’ |
Example 1: Disclose default pairs
"(abc)"
s = print disclose(s) ' Output: abc
Example 2: Disclose non-default pairs
"_abc_"
s = print disclose(s, "__") ' Output: abc
"([abc])"
s = print disclose(s, "[]") ' Output: abc
"([abc])"
s = print disclose(s, "[)") ' Output: abc]
"[(abc)]"
s = print disclose(s, "()[]") ' Output: (abc)
"abc (def)"
s = print disclose(s, "()") ' Output: def
"abc (d(ef))"
s = print disclose(s, "()") ' Output: d(ef)
Example 3: Disclose with ignore-pairs
"abc [d(ef)] (gh)"
s = print disclose(s, "()", "[]") ' Output: gh
Code samples using DISCLOSE
String
ASC
BCS
BIN
CBS
CHOP
CHR
DISCLOSE
ENCLOSE
FORMAT
HEX
INSTR
JOIN
LCASE
LEFT
LEFTOF
LEFTOFLAST
LOWER
LTRIM
MID
OCT
REPLACE
RIGHT
RIGHTOF
RIGHTOFLAST
RINSTR
RTRIM
SINPUT
SPACE
SPC
SPLIT
SPRINT
SQUEEZE
STR
STRING
TRANSLATE
TRIM
UCASE
UPPER
VAL
If there is insufficient information on this page and you wish learn more about DISCLOSE,
please send an email to smallbasic@gmail.com. You can help to improve information about
DISCLOSE by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.