Function voca_rs::chop::first

source ·
pub fn first(subject: &str, length: usize) -> String
Expand description

Extracts the first length characters from subject.

Arguments

  • subject - The string to extract from.
  • length - The number of characters to extract.

Example

use voca_rs::*;
chop::first("helicopter", 1);
// => "h"
chop::first("błąd", 2);
// => "bł"
chop::first("e\u{0301}", 1); // or 'é'
// => "e"
use voca_rs::Voca;
"helicopter"._first(1);
// => "h"