mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-07-24 12:55:01 +02:00
initial commit
This commit is contained in:
commit
c782dde326
61 changed files with 1457 additions and 0 deletions
24
scripts/ch9-06-str-funcs-mod.rsc
Normal file
24
scripts/ch9-06-str-funcs-mod.rsc
Normal file
|
@ -0,0 +1,24 @@
|
|||
# filename: ch9-06-str-funcs-mod.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 ---
|
||||
|
||||
# function to remove last char from a string
|
||||
#
|
||||
# e.g. :local choppedVar [$chopStrFunc "string with extra char,"]
|
||||
#
|
||||
:global ChopStrFunc do={
|
||||
:return [ :pick $1 0 ( [ :len $1 ] -1 ) ];
|
||||
}
|
||||
# --- end of function ---
|
Loading…
Add table
Add a link
Reference in a new issue