Remove repeats

By Sigh_ on Oct 13, 2004

Remove repeats alias by Sigh

Usage: $remrpt(string,C)

Lets you remove repeated tokens from a string

For example: $remrpt(a b c a a b d,32) = a b c d

alias remrpt {
  var %m = $1
  while ($regsub(%m,$replace((?<=^|;)([^;]+)(.*?);\1(?=;|$),;,\x $+ $base($2,10,16,2)),\1\2,%m)) !
  return %m
}

Comments

Sign in to comment.
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.