-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
Copy pathsuperstring.html
96 lines (73 loc) · 2.23 KB
/
superstring.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title> superstring interactive documentation</title>
<link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css">
</head>
<body>
<h1> superstring interactive documentation</h1>
This documentation is live and interactive. It is powered by <a href="https://github.com/viebel/klipse">klipse</a>.
<h2> Setup </h2>
First let's load <b>superstring</b> from the superstring github repository (It might take a couple of seconds...):
<br/>
<br/>
<div class="clojure" data-external-libs="https://raw.githubusercontent.com/expez/superstring/master/src">
(ns my.str
(:require [superstring.core :as str]))
</div>
<h2>slice</h2>
<b>slice</b> returns a slice of s beginning at index and of the given length, or 1.
If index is negative the starting index is relative to the end of the string.
If the requested slice ends outside the string boundaries, we return
the substring of s starting at index.
Returns nil if index falls outside the string boundaries or if
length is negative.
<div class="clojure">
(str/slice "0123456789" 2 5)
</div>
<br/>
<div class="clojure">
(str/slice "0123456789" 2 1)
</div>
<br/>
<div class="clojure">
(str/slice "0123456789" -3 2)
</div>
<h2>swap-case</h2>
<b>swap-case</b> changes lower case characters to upper case and vice versa.
<div class="clojure">
(str/swap-case "AbCdEFgh")
</div>
<h2> includes?</h2>
<div class="clojure">
(str/includes? "Developer" "developer" :ignore-case)
</div>
<br/>
<div class="clojure">
(str/includes? "Developer" "developer")
</div>
<h2> includes-all?</h2>
<div class="clojure">
(str/includes-all? "Java and XML and Clojure" ["java" "xml"] :ignore-case)
</div>
<br/>
<div class="clojure">
(str/includes-all? "Java and XML and Clojure" ["java" "xml"])
</div>
<h2> includes-any?</h2>
<div class="clojure">
(str/includes-any? "Java and Clojure" ["java" "xml"] :ignore-case)
</div>
<br/>
<div class="clojure">
(str/includes-any? "Java and XML and Clojure" ["java" "xml"])
</div>
<script>
window.klipse_settings = {
selector: '.clojure'
};
</script>
<script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
</body>
</html>