generated from chaos-lang/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.kaos
71 lines (67 loc) · 2.14 KB
/
test.kaos
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
import string
// String Operations
print string.upper("hello world")
print string.lower("HeLlO WoRLd")
print string.capitalize("hello world")
print string.capitalize("")
print string.concat("hello", " world")
print string.split("A quick brown fox jumps over the lazy dog", " ")
print string.split("A quick brown fox jumps over the lazy dog")
list a = ["foo", "bar", "baz"]
print string.join(a, " ")
print string.join(a)
print string.join(a, "")
// Searching & Replacing
print string.search("hello world", "world")
print string.search("hello world", "friend")
print string.replace("hello world", "world", "friend")
// Information Functions
print string.length("hello world")
print string.length("")
print string.is_empty("hello world")
print string.is_empty("")
print string.is_numeric("01234")
print string.is_numeric("01234\t")
print string.is_numeric("01234\n")
print string.is_numeric("01234x")
print string.is_numeric(" 01234")
print string.is_numeric(" ")
print string.is_numeric("")
print string.is_alpha("hello world")
print string.is_alpha("hello world\t")
print string.is_alpha("he11o w0rld")
print string.is_alpha("he11o w0rld\n")
print string.is_alpha(" ")
print string.is_alpha("")
print string.is_alnum("he11o w0rld")
print string.is_alnum("he11o w0rld\t")
print string.is_alnum("he11o w0rld\n")
print string.is_alnum(" ")
print string.is_alnum("")
print string.is_space("he11o w0rld\t")
print string.is_space("a")
print string.is_space("1")
print string.is_space("\n")
print string.is_space(" ")
print string.is_space("")
print string.is_lower("hello world")
print string.is_lower("hello world 01234")
print string.is_lower("HELLO WORLD")
print string.is_lower("HeLlO WoRLd")
print string.is_lower(" ")
print string.is_lower("")
print string.is_upper("hello world")
print string.is_upper("HELLO WORLD")
print string.is_upper("HELLO WORLD 01234")
print string.is_upper("HeLlO WoRLd")
print string.is_upper(" ")
print string.is_upper("")
// String Constants
print string.whitespace()
print string.ascii_lowercase()
print string.ascii_uppercase()
print string.ascii_letters()
print string.digits()
print string.hexdigits()
print string.octdigits()
print string.punctuation()