Top

$iscaps


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Sep 28, 2007
Last Updated  Oct 03, 2007
Tags  capital  get  letters  non 

Description

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

Grab the Code

;--------------------------
;- $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) 
      }
    }
  }
}
 

Comments

  (2)  RSS
KuTsuM
Comments: 141
 
mIRC Snippet:  $iscaps
Posted on Oct 3, 2007 11:05 pm
Why do you need to declare "get"? Good regex example.
KuTsuM
Comments: 141
 
mIRC Snippet:  $iscaps
Posted on Oct 3, 2007 11:06 pm
Ignore the above question: You should use the prop parameter ($prop)

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom