laravel-tools/source/lib/string.py
2026-03-06 08:31:05 +01:00

30 lines
504 B
Python

def string_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 string_coin(
template,
arguments
):
result = template
for (key, value, ) in arguments.items():
result = result.replace("{{%s}}" % key, value)
return result