mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-06-21 09:25:42 +02:00
15 lines
384 B
Text
15 lines
384 B
Text
|
# 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 ""
|
||
|
for i from=0 to=([:len $1]-1) do={
|
||
|
:local Tmp [:pick $1 $i]
|
||
|
:if ($Tmp !=" ") do={ :set NewName "$NewName$Tmp" }
|
||
|
}
|
||
|
:return $NewName
|
||
|
}
|
||
|
# --- end of function ---
|