Returns a copy of the BitString with trailing characters removed. If omitted or None, ``'char'`` defaults to "0":: BitString("00010101000").rstrip() == BitString("10101000") BitString("11110101111").rstrip("1") == BitString("10101111")
(self, char: str | None = "0")
| 141 | return BitString(super().lstrip(char), False) |
| 142 | |
| 143 | def rstrip(self, char: str | None = "0") -> BitString: |
| 144 | """Returns a copy of the BitString with trailing characters removed. |
| 145 | |
| 146 | If omitted or None, ``'char'`` defaults to "0":: |
| 147 | |
| 148 | BitString("00010101000").rstrip() == BitString("10101000") |
| 149 | BitString("11110101111").rstrip("1") == BitString("10101111") |
| 150 | """ |
| 151 | if char is None: |
| 152 | char = "0" |
| 153 | return BitString(super().rstrip(char), False) |
| 154 | |
| 155 | def strip(self, char: str | None = "0") -> BitString: |
| 156 | """Returns a copy of the BitString with both leading and trailing |