Skip to content

Commit

Permalink
Adding function to double-quote an input string
Browse files Browse the repository at this point in the history
  • Loading branch information
bfren committed Dec 2, 2024
1 parent 97c457d commit e1000c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions overlay/etc/nu/scripts/bf/string.nu
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use dump.nu
use write.nu

# Add double quotes to the input string and return.
export def quote []: string -> string { $"\"($in)\"" }

# Format a string by using $values to replace placeholders with values within $input:
# - if $values = {a: "one" b: "two"}
# - and $input = "this contains {a} and {b}"
Expand Down

0 comments on commit e1000c6

Please sign in to comment.