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

(Add'l examples)
Line 1: Line 1:
{{mirc title|$remove Identifier}}'''$remove''' removes 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.
  
  
Line 9: Line 9:
  
 
== Example ==
 
== Example ==
 +
'''Show the download folder as a relative location only if it's a subfolder of $mircdire'''
 +
<source lang="mIRC">//echo -a $remove($getdir,$mircdir)</source>
 +
 +
 
'''Remove the channel from a message'''
 
'''Remove the channel from a message'''
<pre>//echo -a $remove($active,$chan)</pre>
+
<source lang="mIRC">//echo -a $remove($active,$chan)</source>
 +
 
 +
'''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">
 +
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)
 +
</source>
 +
 
  
 
== Compatibility ==
 
== Compatibility ==
Line 16: Line 37:
  
 
== See also ==
 
== See also ==
 +
* {{mIRC|$removecs}}
 
* {{mIRC|$replace}}
 
* {{mIRC|$replace}}
{{mIRC identifier list}}
+
* {{mIRC|$replacecs}}
 
+
* {{mIRC|$replacex}}
[[Category:mIRC identifiers|remove]]
+
* {{mIRC|$replacexcs}}
 +
* {{mIRC|$deltok}}
 +
* {{mIRC|$remtok}}
 +
* {{mIRC|$reptok}}

Revision as of 12:57, 1 February 2018

$remove removes all occurrences of the given substring(s) from a string and returns the remainder.


Synopsis

$remove(string,substring,...)

Switches

None

Example

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

//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

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


See also