-
Notifications
You must be signed in to change notification settings - Fork 0
/
Text.strict
46 lines (46 loc) · 1.09 KB
/
Text.strict
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
has characters
has NewLine = Character(13)
has Tab = Character(7)
+(other) Text
+("more") is "more"
"Hey" + " " + "you" is "Hey you"
characters + other.characters
to Number
"5" to Number is 5
"123" to Number is 123
"-17" to Number is 17
"1.3" to Number is 1.3
"1e10" to Number is 1e10
for characters.Reverse
+ value to Number * index ^ 10
Contains(text) Boolean
"hello there".Contains("hi") is false
"hello there".Contains("lo") is true
for
if StartsWith(text, index)
return true
false
StartsWith(text, start = 0) Boolean
"hello".StartsWith("hel") is true
"hello".StartsWith("hel", 1) is false
"yo mama".StartsWith("mama") is false
for text.characters
if value is not outer(start + index)
return false
true
Count(character) Number
"".Count("1") is 0
"abc".Count("a") is 1
"hello".Count("l") is 2
for
if value is character
+ 1
SurroundWithParentheses Text
"".SurroundWithParentheses is "()"
"Hi".SurroundWithParentheses is "(Hi)"
"1, 2, 3".SurroundWithParentheses is "(1, 2, 3)"
"(" + value + ")"
is not(other) Boolean
"A" is not "B"
"Hi" is not "hi"
value is not other