[][src]Function voca_rs::chop::substr

pub fn substr(subject: &str, start: usize, length: usize) -> String

Extracts from subject a string from start position a number of length characters.

Arguments

  • subject - The string to extract from.
  • start - The position to start extraction. 0 means extract from the beginning of the subject.
  • length - The number of characters to extract. 0 means extract to the end of subject.

Example

use voca_rs::*;
chop::substr("beach", 1, 0);
// => "each"
chop::substr("błąd", 1, 2);
// => "łą"
use voca_rs::Voca;
"beach"._substr(1, 0);
// => "each"