Martin Pergler 2fed93cdfd
Better help for format function
Added description of what syntax/parsing engine is used for the formatting. Motivated by https://github.com/qgis/QGIS/issues/42806, but in general a good idea so users can look up more in detail what is possible. Also uniformized spelling (placeholder vs placeholder).
2021-05-05 09:04:36 +10:00

14 lines
883 B
Plaintext

{
"name": "format",
"type": "function",
"groups": ["String"],
"description": "Format a string using supplied arguments.",
"variableLenArguments": true,
"arguments": [ {"arg":"string", "description":"A string with placeholders %1, %2, etc., for the arguments. Placeholders can be repeated. The lowest numbered placeholder is replaced by arg1, the next by arg2, etc."},
{"arg":"arg1", "syntaxOnly": true},
{"arg":"arg2", "syntaxOnly": true},
{"arg":"arg", "descOnly": true, "description":"any type. Any number of arguments."}],
"examples": [ { "expression":"format('This %1 a %2','is', 'test')", "returns":"'This is a test'"},
{ "expression":"format('This is %2','a bit unexpected but 2 is lowest number in string','normal')", "returns":"'This is a bit unexpected but 2 is lowest number in string'"} ]
}