Skip to content

Commit 4519e08

Browse files
AaronC81rgwood
authored andcommitted
Add some str methods to "nu map from ..." tables
`collect` is often named differently in other languages `trim` was already there, but is now `str trim`, so renamed
1 parent 6966c7e commit 4519e08

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

book/nushell_map.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ Note: this table assumes Nu 0.43 or later.
8080
| split column | | - | | |
8181
| split row | | - | | |
8282
| str(`*`) | string functions | String class | String class | |
83+
| str collect | concat_ws | Join | Join-String | |
84+
| str trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | |
8385
| sum | sum | Sum | Measure-Object, measure | |
8486
| sys(`*`) | - | - | Get-ComputerInfo | uname, lshw, lsblk, lscpu, lsusb, hdparam, free |
8587
| table | | | Format-Table, ft, Format-List, fl | |
@@ -88,7 +90,6 @@ Note: this table assumes Nu 0.43 or later.
8890
| tree(`*`) | - | - | tree | |
8991
| to | - | - | Export/ConvertTo-{Csv,Xml,Html,Json} | |
9092
| touch | - | - | Set-Content | touch |
91-
| trim | rtrim, ltrim | Trim, TrimStart, TrimEnd | Trim | |
9293
| uniq | distinct | Distinct | Get-Unique, gu | uniq |
9394
| upsert | As | - | | |
9495
| version | select @@version | - | $PSVersionTable | |

book/nushell_map_functional.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@ Note: this table assumes Nu 0.43 or later.
8282
| split-by | split, split-{at,with,lines} | split, words, lines | split, words, lines | |
8383
| split column | | | | |
8484
| split row | | | | |
85-
| str | clojure.string functions | String functions | | |
85+
| str(`*`) | clojure.string functions | String functions | | |
86+
| str collect | join | concat | intercalate | |
87+
| str trim | trim, triml, trimr | trim, trimLeft, trimRight | strip | |
8688
| sum | apply + | sum | sum | |
8789
| sys | | | | |
8890
| table | | | | |
8991
| tags | | | | |
9092
| tree(`*`) | | | | |
9193
| to | | | | |
9294
| touch | | | | |
93-
| trim | trim, triml, trimr | trim, trimLeft, trimRight | strip | |
9495
| uniq | set | Set.empty | Data.Set | |
9596
| upsert | | | | |
9697
| version | | | | |

book/nushell_map_imperative.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ Note: this table assumes Nu 0.43 or later.
8282
| split column | | | | |
8383
| split row | | | | |
8484
| str(`*`) | str functions | String functions | string functions | &str, String functions |
85+
| str collect | str.join | joinToString | | join |
86+
| str trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim_{start,end}, strip_{suffix,prefix} |
8587
| sum | sum | sum | reduce | sum |
8688
| sys(`*`) | sys | | | |
8789
| table | | | | |
8890
| tags | | | | |
8991
| tree(`*`) | | | | |
9092
| to | csv, json, sqlite3 | | | |
9193
| touch | open(path, 'a').close() | | | |
92-
| trim | strip, rstrip, lstrip | trim, trimStart, trimEnd | regex | trim, trim_{start,end}, strip_{suffix,prefix} |
9394
| uniq | set | Set | set | HashSet |
9495
| upsert | | | | |
9596
| version | sys.version, sys.version_info | | | |

0 commit comments

Comments
 (0)