We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c09d4a commit 87408b9Copy full SHA for 87408b9
src/string/lower_case.jule
@@ -0,0 +1,9 @@
1
+pub fn lower_case(mut string: str): str {
2
+ for i, c in string {
3
+ if c >= 'A' && c <= 'Z' {
4
+ string[i] = 'z' - ('Z' - c)
5
+ }
6
7
+
8
+ ret string
9
+}
test.jule
@@ -16,6 +16,7 @@ use src::string::{
16
is_alpha,
17
is_digit,
18
upper_case,
19
+ lower_case,
20
}
21
22
static mut TESTS: TestStack = TestStack.new()
@@ -85,6 +86,10 @@ fn add_tests_string() {
85
86
TESTS.add("upper_case", fn(): bool {
87
ret upper_case("foO") == "FOO"
88
})
89
90
+ TESTS.add("lower_case", fn(): bool {
91
+ ret lower_case("FOo") == "foo"
92
+ })
93
94
95
fn main() {
0 commit comments