Pfx.remove
You're seeing just the function
remove
, go back to Pfx module for more information.
Specs
remove(t(), non_neg_integer(), non_neg_integer()) :: t()
Removes length
bits from pfx
-s bitstring, starting at position
.
A negative position
is relative to the end of the pfx.bits
-string.
Valid range for position
is -bit_size(pfx.bits) .. bit_size(pfx.bits)-1
.
If length
is positive, bits are removed to the right. If it is negative
bits are removed going to the left.
Notes:
length
is silently clipped to the maximum number of bits available to remove- removing bits from
pfx.bits
does not change itspfx.maxlen
Examples
iex> remove("1.2.3.4", 8, 8)
"1.3.4.0/24"
iex> remove("1.2.3.128/25", -1, 1)
"1.2.3.0/24"
iex> remove("0288.88FF.FE88.8888", 24, 16)
"02-88-88-88-88-88-00-00/48"