From WikiChip
Difference between revisions of "mirc/identifiers/$remove"
< mirc‎ | identifiers

(Add'l examples)
(See also)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{mirc title|$remove Identifier}}'''$remove''' removes all occurrences of the given substring(s) from a string and returns the remainder.
+
{{mirc title|$remove Identifier}}'''$remove''' removes all occurrences of the given substring(s) from a string and returns the remainder. '''$removecs''' is the case sensitive version.
  
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$remove(string,substring,...)</pre>
+
<pre>$remove(string,substring,substringN)
 +
$removecs(string,substring,substringN)
 +
</pre>
  
== Switches ==
+
== Parameters ==
None
+
* '''string''' - the original string you want to remove from
 +
* '''substring''' - the substring you want to remove from the original string, you can
 +
* '''substringN''' - you can pass multiple substring to be removed from the original string
  
 
== Example ==
 
== Example ==
'''Show the download folder as a relative location only if it's a subfolder of $mircdire'''
+
 
 +
'''Show the download folder as a relative location only if it's a subfolder of $mircdir'''
 
<source lang="mIRC">//echo -a $remove($getdir,$mircdir)</source>
 
<source lang="mIRC">//echo -a $remove($getdir,$mircdir)</source>
  
Line 37: Line 42:
  
 
== See also ==
 
== See also ==
* {{mIRC|$removecs}}
 
 
* {{mIRC|$replace}}
 
* {{mIRC|$replace}}
* {{mIRC|$replacecs}}
 
 
* {{mIRC|$replacex}}
 
* {{mIRC|$replacex}}
* {{mIRC|$replacexcs}}
 
 
* {{mIRC|$deltok}}
 
* {{mIRC|$deltok}}
 
* {{mIRC|$remtok}}
 
* {{mIRC|$remtok}}
 
* {{mIRC|$reptok}}
 
* {{mIRC|$reptok}}

Latest revision as of 07:45, 15 February 2018

$remove removes all occurrences of the given substring(s) from a string and returns the remainder. $removecs is the case sensitive version.


Synopsis[edit]

$remove(string,substring,substringN)
$removecs(string,substring,substringN)

Parameters[edit]

  • string - the original string you want to remove from
  • substring - the substring you want to remove from the original string, you can
  • substringN - you can pass multiple substring to be removed from the original string

Example[edit]

Show the download folder as a relative location only if it's a subfolder of $mircdir

//echo -a $remove($getdir,$mircdir)


Remove the channel from a message

//echo -a $remove($active,$chan)

Show the download folder as a relative location only if it's a subfolder of $mircdir

//echo -a $remove($getdir,$mircdir)
Case-insensitive remove all 'a' from 'aAabcdaaA'
//echo -a $remove(aAabcdaaA,a)
returns: bcd
Case-insensitive remove string 'ac' from 'AaCcX'
//echo -a $remove(AaCcX,ac)
returns: AcX
The first match was at positions 2-3, and no matches were beyond.
//echo -a $remove(AaCcX,ac,ac)
... uses string altered by 1st parameter when removing 2nd parameter string. Is equivalent to:
//echo -a $remove( $remove(AaCcX,ac) , ac)


Compatibility[edit]

Added: mIRC v4.52
Added on: 07/06/1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See also[edit]