mirror of
https://github.com/furaihan/simple-mikrotik-script.git
synced 2025-07-05 12:14:31 +02:00
added convert case fuction
This commit is contained in:
parent
0d994f2232
commit
f03e93151b
1 changed files with 26 additions and 1 deletions
27
first-setup
27
first-setup
|
@ -1,4 +1,4 @@
|
|||
#Add a new scheduler setting with folowwing event:
|
||||
#Add a new scheduler setting with following event:
|
||||
#Change telegram chat id below with your own
|
||||
:global CHATID ("-4936xxx")
|
||||
#Change telegram bot id below with your own
|
||||
|
@ -13,3 +13,28 @@
|
|||
return "Error! this probably cause from unknown vendor or a connection problem"
|
||||
}
|
||||
}
|
||||
global ConvertLowerCase do={
|
||||
local alphabet {"A"="a";"B"="b";"C"="c";"D"="d";"E"="e";"F"="f";"G"="g";"H"="h";"I"="i";"J"="j";"K"="k";"L"="l";"M"="m";"N"="n";"O"="o";"P"="p";"Q"="q";"R"="r";"S"="s";"T"="t";"U"="u";"V"="v";"X"="x";"Z"="z";"Y"="y";"W"="w"};
|
||||
local result
|
||||
local character
|
||||
for strings from=0 to=([:len $1] - 1) do={
|
||||
local single [:pick $1 $strings]
|
||||
set character ($alphabet->$single)
|
||||
if ([:typeof $character] = "str") do={set single $character}
|
||||
:set result ($result.$single)
|
||||
}
|
||||
:return $result
|
||||
}
|
||||
|
||||
global ConvertUpperCase do={
|
||||
local alphabet {"a"="A";"b"="B";"c"="C";"d"="D";"e"="E";"f"="F";"g"="G";"h"="H";"i"="I";"j"="J";"k"="K";"l"="L";"m"="M";"n"="N";"o"="O";"p"="P";"q"="Q";"r"="R";"s"="S";"t"="T";"u"="U";"v"="V";"x"="X";"z"="Z";"y"="Y";"w"="W"};
|
||||
local result
|
||||
local character
|
||||
for strings from=0 to=([:len $1] - 1) do={
|
||||
local single [:pick $1 $strings]
|
||||
set character ($alphabet->$single)
|
||||
if ([:typeof $character] = "str") do={set single $character}
|
||||
:set result ($result.$single)
|
||||
}
|
||||
:return $result
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue