wifinigel.MikrotikScripting/scripts/v6/ch9-04-create-global-func.rsc

15 lines
402 B
Text
Raw Normal View History

2023-01-19 21:27:15 +00:00
# filename: ch9-04-create-global-func.rsc
# function to remove spaces from a string
#
# e.g. :local NoSpaceVar [$RemoveSpaceFunc "string with spaces"]
#
:global RemoveSpaceFunc do={
:local NewName ""
2023-03-06 20:56:48 +00:00
for CharNumber from=0 to=([:len $1]-1) do={
:local Tmp [:pick $1 $CharNumber]
2023-01-19 21:27:15 +00:00
:if ($Tmp !=" ") do={ :set NewName "$NewName$Tmp" }
}
:return $NewName
}
# --- end of function ---