1 unstable release
0.1.0 | Jan 24, 2025 |
---|
#188 in #script
120 downloads per month
5KB
57 lines
io_capitalize crate for Rust
This crate will make writing inputs in Rust alot easier as Python.
How to Use:
use io_capitalize::*;
// Import the crate to use.
fn main() {
let mut ask = input_str("How are you? ).to_lowercase;
if ask.contains(good) || ask.contains(nice) || ask.contains(cool) {
ask = "good".to_string();
// If you want to reassign your muttable variable, you must convert it to String. (&str aren't compatible.)
print!("{}? Nice.", ask.capitalize());
}
else {
print!("OH!");
}
// See how much simple it is? Also it works with other types by: (input_int) both i64 and i32, (input_float) both f64 and f32, (input_bool) for booleans.
// And the capitalize method is integrated, it is a Python equivalent of .capitalize() string method, useful to have though.
}