The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Pad A Rust String With Leading Spaces

TODO: Pull subtitle into page object
Code
fn main() {
  let word = "alfa".to_string();
  let updated = format!("~~{:>10}~~", word);
  println!("{}", updated);

}
Results
~~      alfa~~

Can also do `{:<10}`` for right padding and `{:^10}`` for centered

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Pad A Rust String With Leading Spaces


-- code
-- rust

fn main() {
  let word = "alfa".to_string();
  let updated = format!("~~{:>10}~~", word);
  println!("{}", updated);

}

-- results/

~~      alfa~~

-- /results


Can also do `{:<10}`` for right padding
and `{:^10}`` for centered


-- categories
-- Rust 

-- metadata
-- date: 2023-12-21 17:25:55
-- id: 2zs4fphk
-- site: aws
-- type: post
-- status: published