From 8318d59ef1d0bc613089b17f3a40480bb7417f62 Mon Sep 17 00:00:00 2001 From: pwygab <88221256+merelymyself@users.noreply.github.com> Date: Tue, 7 Jun 2022 19:09:16 +0800 Subject: [PATCH] improve str substring (#5730) --- crates/nu-command/src/strings/str_/substring.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/strings/str_/substring.rs b/crates/nu-command/src/strings/str_/substring.rs index a53da20ca6..4427bc4237 100644 --- a/crates/nu-command/src/strings/str_/substring.rs +++ b/crates/nu-command/src/strings/str_/substring.rs @@ -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 { 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")), },