Dasel
v2
v2
  • Introduction
  • GitHub
  • Supported file formats
  • Memory usage
  • Installation
  • Commands
    • Select
    • Put
    • Delete
  • Functions
    • Selector Overview
    • All
    • And
    • Append
    • Count
    • Equal
    • Filter
    • FilterOr
    • First
    • Index
    • Join
    • Key
    • Keys
    • Last
    • Len
    • LessThan
    • MapOf
    • Merge
    • MoreThan
    • Not
    • Or
    • OrDefault
    • Parent
    • Property
    • String
    • Null
    • This
    • Type
  • Examples
    • Using dasel as a go package
    • Basics
    • Change file format
    • Filtering objects based on present/missing key
Powered by GitBook
On this page
  • Examples
  • Basic
  • Add fixed values to maps
Edit on GitHub
  1. Functions

String

String is a basic function that allows you to return a plain string value.

Expects 1 argument.

If you wish to use a comma in your string you must escape it with a backslash \,.

Examples

Basic

$ echo '{}' | dasel -r json 'string(my string)' 
"my string"

Add fixed values to maps

$ echo '{
  "name": "Tom Wright"
}' | dasel -r json 'mapOf(name,name,title,string(Mr))' 
{
  "name": "Tom Wright",
  "title": "Mr"
}
PreviousPropertyNextNull

Last updated 1 year ago