string-format icon indicating copy to clipboard operation
string-format copied to clipboard

Support named arguments with spaces and special characters

Open makenoteshere opened this issue 9 years ago • 3 comments

Hi, davidchambers, Can named arguments, object keys with spaces ('avg val') or special characters (#, _ etc) be supported?

var user = {name: "Dolly", age: 24, 'in co': 23, '#':1}
undefined
"{name} - {age}".format(user)
"Dolly - 24"
"{name} - {age} - {in co}".format(user)
"Dolly - 24 - {in co}"
"{name} - {age} - {#}".format(user)
"Dolly - 24 - {#}"

makenoteshere avatar Apr 12 '16 17:04 makenoteshere

This is supported in the mini-language branch. One of these days I should merge #2!

davidchambers avatar Apr 13 '16 04:04 davidchambers

Look forward to it. Thanks.

makenoteshere avatar Apr 13 '16 17:04 makenoteshere

Hi, Awesome work!

One of these days I should merge #2!

There ware quite long days, could you merge it? Python format mini-language in JS – its incredible!

rysson avatar Jul 11 '18 07:07 rysson