Function coded_chars::control::rendition::format_str
source · pub fn format_str(str: &str, format: &GraphicSelection) -> String
Expand description
Format a string with the specified SGR
sequence.
The string is terminated with the sequence \x1b[0m
to reset the style.
§Example
use coded_chars::control::rendition::{format_str, select_graphic};
let formatted = format_str(
"World",
select_graphic().fg_red().bold().underline()
);
println!("Hello {} !", formatted);