This is a simple code that returns the percentage of capital and non-capital letters in a line of text.
For example:
If I were to type: //echo -a $iscaps(III).get it would return %100. If I were to type: //echo -a $iscaps(iII).non it would return %33.3
The syntax is either: $iscaps(string).get or $iscaps(string).non
;--------------------------
;- $iscaps - Saeed * 2007 -
;--------------------------
;--- Usage ----------------
;--- $iscaps(string).get --
;--- $iscaps(string).non --
;--------------------------
alias iscaps {
if ($isid) {
if ($prop = get) {
if ($2-) {
var %i $regex($2-,/[A-Z]/g), %t = $len($2-)
return $calc(%i / %t * 100)
}
}
if ($prop = non) {
if ($2-) {
var %i = $regex($2-,/[^A-Z]/g),%t = $len($2-)
return $calc(%i / %t * 100)
}
}
}
}