From WikiChip
Editing mirc/string manipulation
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 127: | Line 127: | ||
=== Replacement === | === Replacement === | ||
− | There are two built-in string replacement identifiers, {{mirc|$replace}} and {{mirc|$replacex}}. The major difference between the two is that the later one will not apply replacement to any of the replaced strings. | + | There are two built-in string replacement identifiers, {{mirc|$replace}} and {{mirc|$replacex}}. The major difference between the two is that the later one will not apply replacement to any of the replaced strings. The syntax for both of them is: |
− | |||
− | |||
− | |||
− | The syntax for both of them is: | ||
<syntaxhighlight lang="mIRC">$replace(<string>, <substring>, <replacement>[, <substring2>, <replacement2>, ...]) | <syntaxhighlight lang="mIRC">$replace(<string>, <substring>, <replacement>[, <substring2>, <replacement2>, ...]) | ||
Line 154: | Line 150: | ||
<pre>5 5 5 5 | <pre>5 5 5 5 | ||
2 3 4 5</pre> | 2 3 4 5</pre> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
'''Note:''' {{mirc|$replacecs}}/{{mirc|$replacexcs}} are case-sensitive versions of {{mirc|$replace}}/{{mirc|$replacex}}; it has the same syntax. | '''Note:''' {{mirc|$replacecs}}/{{mirc|$replacexcs}} are case-sensitive versions of {{mirc|$replace}}/{{mirc|$replacex}}; it has the same syntax. | ||
Line 211: | Line 198: | ||
* m = use messages option settings | * m = use messages option settings | ||
− | == Using {{mirc|Token Manipulation}} == | + | == Using {{mirc|token manipulation|Token Manipulation}} == |
Whilst the {{mirc|token manipulation}} functionality is designed to be used for maintaining lists of delimited tokens, they can also be used for string manipulation. For example, extracting a channel from a string can be done with: | Whilst the {{mirc|token manipulation}} functionality is designed to be used for maintaining lists of delimited tokens, they can also be used for string manipulation. For example, extracting a channel from a string can be done with: | ||