Excess Letter removal.

Paste Your small code(s) here, ex. small aliases, identifiers

Excess Letter removal.

Postby SilverRain » Fri Jan 02, 2009 5:24 pm

Code: Select all
alias excess { 
  var %x = 1,%r
  while ($mid($1-,%x,1)) {
    if (%x != 1 && $mid($1-,%x,1) != $mid(%r,$len(%r),1) && $mid(%r,$calc(%r - 1),1) && $istok(a b c d e f g h i j k l m n o p q r s t u v w x y z,$mid($1-,%x,1),32)) { var %r = $+(%r,$mid($1-,%x,1))  }
    elseif (%x == 1) { var %r = $+(%r,$mid($1-,$ifmatch,1)) }
    inc %x
  }
  !return %r
}


$excess(fuuuuuuuckkkkkkkkkkkkkkk) returns: fuck
$excess(spammmmmmmmmmmmm) returns: spam
SilverRain
 

Re: Excess Letter removal.

Postby Cristian » Sat Jan 03, 2009 1:19 am

Nice script, excellent idea, I love it.

I have a suggestion, if you like.
What I have in mind, making the script ignore double characters, but striping all others.

Code: Select all
$excess(excess) returns exces
$excess(letter) returns leter


So these will pass.

Code: Select all
$excess(excess) returns excess
$excess(letter) returns letter
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar


Return to Mirc Scripting Snippets

Who is online

Users browsing this forum: No registered users and 2 guests

cron