Skip to main content

to_string

Function to_string 

Source
pub fn to_string(bytes: &[u8]) -> String
Expand description

Converts a vector of bytes to a string.

§Arguments

  • bytes - A slice of bytes to convert.

§Returns

  • A String containing the converted text.

§Examples

let bytes = vec![104, 101, 108, 108, 111];
let result = loki_text::utils::to_string(&bytes);
assert_eq!(result, "hello");