mirror of
https://github.com/Kindelia/Kind2.git
synced 2024-10-26 16:20:40 +03:00
create to_lower and to_upper functions
This commit is contained in:
parent
332b88d679
commit
65440277e6
5
base/Char/to_lower.kind
Normal file
5
base/Char/to_lower.kind
Normal file
@ -0,0 +1,5 @@
|
||||
Char.to_lower(char: Char): Char
|
||||
if Bool.and(U16.gte(char, 'A'), U16.lte(char, 'Z')) then
|
||||
U16.add(char, 32#16)
|
||||
else
|
||||
char
|
5
base/Char/to_upper.kind
Normal file
5
base/Char/to_upper.kind
Normal file
@ -0,0 +1,5 @@
|
||||
Char.to_upper(char: Char): Char
|
||||
if Bool.and(U16.gte(char, 'a'), U16.lte(char, 'z')) then
|
||||
U16.sub(char, 32#16)
|
||||
else
|
||||
char
|
2
base/String/to_lower.kind
Normal file
2
base/String/to_lower.kind
Normal file
@ -0,0 +1,2 @@
|
||||
String.to_lower(str: String): String
|
||||
String.map(Char.to_lower, str)
|
2
base/String/to_upper.kind
Normal file
2
base/String/to_upper.kind
Normal file
@ -0,0 +1,2 @@
|
||||
String.to_upper(str: String): String
|
||||
String.map(Char.to_upper, str)
|
Loading…
Reference in New Issue
Block a user