mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-07-10 10:04:29 +02:00
initial commit
This commit is contained in:
commit
c782dde326
61 changed files with 1457 additions and 0 deletions
15
scripts/ch9-04-create-global-func.rsc
Normal file
15
scripts/ch9-04-create-global-func.rsc
Normal file
|
@ -0,0 +1,15 @@
|
|||
# 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 ---
|
Loading…
Add table
Add a link
Reference in a new issue