improve str substring (#5730)

This commit is contained in:
pwygab 2022-06-07 19:09:16 +08:00 committed by GitHub
parent 64efa30f3e
commit 8318d59ef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ impl Command for SubCommand {
}
fn usage(&self) -> &str {
"Get part of a string"
"Get part of a string. Note that the start is included but the end is excluded, and that the first character of a string is index 0."
}
fn search_terms(&self) -> Vec<&str> {
@ -65,7 +65,7 @@ impl Command for SubCommand {
fn examples(&self) -> Vec<Example> {
vec![
Example {
description: "Get a substring from the text",
description: "Get a substring \"nushell\" from the text \"good nushell\"",
example: " 'good nushell' | str substring [5 12]",
result: Some(Value::test_string("nushell")),
},