Crates.io | string-simple |
lib.rs | string-simple |
version | 0.1.0 |
source | src |
created_at | 2024-11-23 23:00:13.850625 |
updated_at | 2024-11-23 23:00:13.850625 |
description | A library containing some simple string utilities that I use in my other projects. |
homepage | |
repository | https://github.com/KalevGonvick/string-simple |
max_upload_size | |
id | 1458798 |
size | 33,772 |
This utility library contains a collection of string functions that I use in my other projects.
[dependencies]
string-simple = "0.1.0"
use string_simple::builder::StringBuilder;
const LOOP_COUNT: u8 = 10;
fn main() {
let mut new_builder = StringBuilder::new();
let mut counter = 0;
while counter < LOOP_COUNT {
if counter % 2 == 0 {
new_builder.append("even");
} else {
new_builder.append("odd");
}
if counter + 1 != LOOP_COUNT {
new_builder.append(" ");
}
counter += 1;
}
// result = "even odd even odd..."
let result = new_builder.build();
}