laravel-tools/source/lib/string.py
Christian Fraß b4be19fec2 [mod]
2026-09-17 17:01:48 +02:00

30 lines
490 B
Python

def wrap(
value,
character_open,
character_close,
options = None
):
options = (
{
"mode": True,
}
|
(options or {})
)
return (
(character_open + value + character_close)
if options["mode"] else
value
)
def coin(
template,
arguments
):
result = template
for (key, value, ) in arguments.items():
result = result.replace("{{%s}}" % key, value)
return result