File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """
2+ char(numbers...)
3+
4+ Convert a list of numbers to a string with the corresponding characters
5+
6+ ```jldoctest
7+ julia> using QuerySQLite
8+
9+ julia> char(65, 90)
10+ "AZ"
11+ ```
12+ """
13+ char (numbers... ) = string (map (Char, numbers)... )
14+ export char
15+
16+ """
17+ if_else(switch, yes, no)
18+
19+ `ifelse` that you can add methods to.
20+
21+ ```jldoctest
22+ julia> using QuerySQLite
23+
24+ julia> if_else(true, 1, 0)
25+ 1
26+
27+ julia> if_else(false, 1, 0)
28+ 0
29+ ```
30+ """
31+ function if_else (switch, yes, no)
32+ ifelse (switch, yes, no)
33+ end
34+ export if_else
35+
36+ """
37+ instr(haystack, needle)
38+
39+ Find the first index of `needle` in `haystack`.
40+
41+ ```jldoctest
42+ julia> using QuerySQLite
43+
44+ julia> instr("QuerySQLite", "SQL")
45+ 6
46+ ```
47+ """
48+ function instr (haystack, needle)
49+ first (findfirst (needle, haystack))
50+ end
51+ export instr
52+
53+ """
54+ type_of(it)
55+
56+ `typeof` that you can add methods to.
57+
58+ ```jldoctest
59+ julia> using QuerySQLite
60+
61+ julia> type_of('a')
62+ Char
63+ ```
64+ """
65+ function type_of (it)
66+ typeof (it)
67+ end
68+ export type_of
You can’t perform that action at this time.
0 commit comments