$text (Getting various aspects of caps in text)

By TokenMaster on Sep 08, 2005



$text snippet by {{CrAdLe}}


Uses :
$text($1-).caps
$text($1-).lower
$text($1-).perupper
$text($1-).perlower


  • $text($1-).caps -
    This will return the number of caps in a sentence
    This will not count numbers whilst $isupper(1) will give you $true
    Anyway you can try the syntax //echo -a $text(Text Caps).caps
    and it will give you 2


  • $text($1-).lower -
    This will return the number of lower letter (not caps) in a sentence
    This will not count numbers whilst $islower(1) will give you $true
    Anyway you can try the syntax //echo -a $text(tEXT cAPS).lower
    and it will give you 2


  • $text($1-).perupper and $text($1-).perlower -
    These are more or less the same but they will give you the percentage



    Eg. $text(THis).perupper will give you 50 (You can add "%" if you want too)
alias text {
  if ($prop == caps) {
    return $regex($1-,/[A-Z]/g)
  }
  if ($prop == lower) {
    return $regex($1-,/[a-z]/g)  
  }
  if ($prop == perupper) {
    var %a = $regex($1-,/[A-Z]/g)
    var %r = $remove($1-,$chr(32))
    return $calc($calc(%a / $len(%r)) * 100)
  }
  if ($prop == perlower) {
    var %a = $regex($1-,/[a-z]/g)
    var %r = $remove($1-,$chr(32))
    return $calc($calc(%a / $len(%r)) * 100)
  }
}

Comments

Sign in to comment.
guest598594   -  Oct 05, 2007

i like the perupper and perlower part, can be very useful with \"caps kicking\" scripts

 Respond  
guest598594   -  Oct 05, 2007

remotes (alt+r)

 Respond  
Clouds   -  Oct 05, 2007

Where do you put it?

 Respond  
Noutrious   -  Sep 16, 2005

I really used this snippet and it helped me out very much! Your good scripter dude :)) Continue like this!

 Respond  
TokenMaster   -  Sep 10, 2005

Thanks Tomijz

 Respond  
Noutrious   -  Sep 09, 2005

Good dude, good :) really nice job :)

 Respond  
TokenMaster   -  Sep 09, 2005

well, im not saying i want high scores.. im only trying to see what is wrong in my snippets .. so i can at least try to change my scripting style :)

 Respond  
DarthReven   -  Sep 09, 2005

Tokenmaster, here on hawkee reviewers don\'t always need to justify thier scores within the snippet section. Wheather this is a good ideam or not is debateable. But it has worked for the site in the past and as long as it works I wouldn\'t consider egging on people that give you \"low scores\". Remember your biggest critic is yourself

 Respond  
TokenMaster   -  Sep 08, 2005

The one who gave me 5. Why do you not give comments and tell me what`s wrong in my snippets ? :)

 Respond  
TokenMaster   -  Sep 08, 2005

Thanks xDaeMoN

 Respond  
xDaeMoN   -  Sep 08, 2005

Nice Job.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.