-
Notifications
You must be signed in to change notification settings - Fork 3
/
ToUpper.txt
10 lines (10 loc) · 1 KB
/
ToUpper.txt
1
2
3
4
5
6
7
8
9
10
################################################################################
#Convert string to UpCase [$UpCase "string" ];
#:put [$UpCase "OSAma" ];
:global UpCase do={
:local C ("\41","\42","\43","\44","\45","\46","\47","\48","\49","\4A","\4B","\4C","\4D","\4E","\4F","\50","\51","\52","\53","\54","\55","\56","\57","\58","\59","\5A","\61","\62","\63","\64","\65","\66","\67","\68","\69","\6A","\6B","\6C","\6D","\6E","\6F","\70","\71","\72","\73","\74","\75","\76","\77","\78","\79","\7A");
:local U ("\41","\42","\43","\44","\45","\46","\47","\48","\49","\4A","\4B","\4C","\4D","\4E","\4F","\50","\51","\52","\53","\54","\55","\56","\57","\58","\59","\5A","\41","\42","\43","\44","\45","\46","\47","\48","\49","\4A","\4B","\4C","\4D","\4E","\4F","\50","\51","\52","\53","\54","\55","\56","\57","\58","\59","\5A");
:local o "";
:for i from=0 to=([:len $1]-1) do={:if ([:len [:find $C [:pick $1 $i]]]!=0) do={:set $o ($o.[:pick $U [:find $C [:pick $1 $i]]]);} else={:set $o ($o.[:pick $1 $i]);}}
:return $o;
}