diff --git a/crates/nu-command/src/strings/str_/trim/trim_.rs b/crates/nu-command/src/strings/str_/trim/trim_.rs index 49e9152950..f6ce8a369d 100644 --- a/crates/nu-command/src/strings/str_/trim/trim_.rs +++ b/crates/nu-command/src/strings/str_/trim/trim_.rs @@ -133,27 +133,22 @@ impl Command for SubCommand { result: Some(Value::test_string("Nu shell")), }, Example { - description: "Trim a specific character", - example: "'=== Nu shell ===' | str trim --char '=' | str trim", - result: Some(Value::test_string("Nu shell")), + description: "Trim a specific character (not the whitespace)", + example: "'=== Nu shell ===' | str trim --char '='", + result: Some(Value::test_string(" Nu shell ")), }, Example { description: "Trim whitespace from the beginning of string", example: "' Nu shell ' | str trim --left", result: Some(Value::test_string("Nu shell ")), }, - Example { - description: "Trim a specific character", - example: "'=== Nu shell ===' | str trim --char '='", - result: Some(Value::test_string(" Nu shell ")), - }, Example { description: "Trim whitespace from the end of string", example: "' Nu shell ' | str trim --right", result: Some(Value::test_string(" Nu shell")), }, Example { - description: "Trim a specific character", + description: "Trim a specific character only from the end of the string", example: "'=== Nu shell ===' | str trim --right --char '='", result: Some(Value::test_string("=== Nu shell ")), },