Open
Description
cannot convert to string, the value is HELLO WORLD.
fn to_uppercase(text: str) -> str {
return text.to_uppercase();
}
fn remove_spaces(text: str) -> str {
return text.replace(" ", "");
}
fn count_chars(text: str) -> int {
return len(text);
}
let result = "Hello World"
|> to_uppercase // "HELLO WORLD"
|> remove_spaces // "HELLOWORLD"
|> count_chars; // 10
print(result); // 10
However, this works:
let result = "Hello World"
|> remove_spaces // "HELLOWORLD"
|> to_uppercase // "HELLO WORLD"
|> count_chars; // 10