BitOffString (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 24: Line 24:


==See also==
==See also==
<table>
<tr>
<td>
<ul>
<ul>
<li><var>[[BitAndString (String function)|BitAndString]]</var>
<li><var>[[BitAndString (String function)|BitAndString]]</var>
Line 30: Line 33:
<li><var>[[BitXorString (String function)|BitXorString]]</var>
<li><var>[[BitXorString (String function)|BitXorString]]</var>
</ul>
</ul>
</td>
<td>
<ul>
<li><var>[[BitClearString, BitFlipString, and BitSetString (String functions)|BitClearString, BitFlipString, and BitSetString]]</var>
<li><var>[[BitValueString (String function)|BitValueString]]</var>
<li><var>[[BitCountString (String function)|BitCountString]]</var>
</ul>
</td>
[[Category:Bit manipulation methods]]
[[Category:Bit manipulation methods]]
{{Template:String:BitOffString footer}}
{{Template:String:BitOffString footer}}

Revision as of 01:05, 22 March 2013

Clear bits in one string from another (String class)

[Introduced in Sirius Mods 7.9]


BitOffString turns off a set of bits in one string as indicated by another.

Syntax

%result = string:BitOffString( offBits, [Pad= c])

Syntax terms

%resultA string to receive the result of turning off the bits in offBits for string.
string The string to turn off bits in.
offBits The bits to turn off.
Pad A single character that indicates the character with which the shorter of the two input strings is to be extended. As many copies of c are used as is required to make the shorter string as long as the longer. If both strings are of equal length, no padding is required. The default value of Pad is '00':x.

Usage notes

  • Using a null string for offBits is an easy way of turning off a specific set of bits for each byte in a string (the Pad value).
  • BitOffString is most useful for working with binary data, for example binary data being sent or received with Janus Sockets.

See also