-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslide.html
133 lines (125 loc) · 4.62 KB
/
slide.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="generator" content="pandoc">
<meta name="author" content="Shuyi Wang">
<title>Filter String</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="reveal.js/css/reset.css">
<link rel="stylesheet" href="reveal.js/css/reveal.css">
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<link rel="stylesheet" href="reveal.js/css/theme/league.css" id="theme">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'reveal.js/css/print/pdf.css' : 'reveal.js/css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="reveal.js/lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section id="title-slide">
<h1 class="title">Filter String</h1>
<p class="author">Esther Zhang</p>
<p class="date">Oct 2021</p>
</section>
<section><section id="introduction" class="slide level2">
<h2>Demands</h2>
<p> Strip out the Spaces and symbols first, and then turn all lowercase to see if it is "yeezy"</p>
</section><section id="welcome" class="slide level2">
<h2>FOCUS</h2>
<p> Strip out the Spaces and symbols </p>
<ul>
<li class="fragment">remove all spaces</li>
<li class="fragment">filter text to pure english string</li>
</ul>
</section><section id="remove spaces" class="slide level2">
<h2>remove All Sapce</h2>
<pre>
func replacingOccurrences(of target: String,
with replacement: String,
options: NSString.CompareOptions = [],
range searchRange: NSRange) -> String
</pre>
<div style="padding:20px; font-size: 16px;">
<p><b>.literal</b> : compare every character<br>
<b>.caseInsensitive</b> : match letters in the pattern independent of case</p>
</div>
</section>
<section id="filter character" class="slide level2">
<h2>filter text to pure english string</h2>
<p>1. set regex</p>
<pre>
init(pattern: String,
options: NSRegularExpression.Options = [])
</pre>
<div style="padding:20px; font-size: 16px;">
<p><b>pattern</b> : The regular expression pattern to compile<br></p>
</div>
<pre>
let regexStr = "[^a-zA-Z]"
let regex = try? NSRegularExpression.init(pattern: regexStr, options: .caseInsensitive)
</pre>
</section>
<section id="filter character" class="slide level2">
<p>2. use regex</p>
<pre>
func stringByReplacingMatches(in string: String,
options: NSRegularExpression.MatchingOptions = [],
range: NSRange,
withTemplate templ: String) -> String
</pre>
<div style="padding:20px; font-size: 16px;">
<p><b>string</b> : The string to search for values within.<br>
<b>options</b> : The matching options to use.<br>
<b>range</b> : The range of the string to search<br>
<b>template</b> : The substitution template used when replacing matching instances<br>
</p>
</div>
<pre>
regex?.stringByReplacingMatches(in: self,
options: [],
range: NSRange(location: 0, length: self.count),
withTemplate: "")
</pre>
</section>
<section id="the-end" class="slide level2">
<h2>The End</h2>
<p>Thanks for your time!</p>
</section></section>
</div>
</div>
<script src="reveal.js/js/reveal.js"></script>
<script>
// Full list of configuration options available at:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
navigationMode: 'linear',
// Push each slide change to the browser history
history: true,
// Transition style
transition: 'convex', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true },
{ src: 'reveal.js/plugin/notes/notes.js', async: true }
]
});
</script>
</body>
</html>