truncate

Function truncate 

Source
pub fn truncate(s: &str, max_chars: usize) -> &str
Expand description

Truncates a string to a single line with a max width and removes docker prefixes.

ยงExample

use docker_bisect::truncate;
let line = "blar #(nop) real command\n line 2";
assert_eq!("real com", truncate(&line, 8));