global-functions: introduce $CharacterMultiply

This commit is contained in:
Christian Hesse 2023-12-04 10:56:48 +01:00
parent 15e347303b
commit 8f24b4c490

View file

@ -24,6 +24,7 @@
:global CertificateAvailable;
:global CertificateDownload;
:global CertificateNameByCN;
:global CharacterMultiply;
:global CharacterReplace;
:global CleanFilePath;
:global DeviceInfo;
@ -172,6 +173,15 @@
name=[ $CharacterReplace [ $CharacterReplace [ $CharacterReplace $CommonName "'" "-" ] " " "-" ] "---" "-" ];
}
# multiply given character(s)
:set CharacterMultiply do={
:local Return "";
:for I from=1 to=$2 do={
:set Return ($Return . $1);
}
:return $Return;
}
# character replace
:set CharacterReplace do={
:local String [ :tostr $1 ];