Returns a copy of the BitString with leading characters removed. If omitted or None, 'chars' defaults '0':: BitString("00010101000").lstrip() == BitString("00010101") BitString("11110101111").lstrip("1") == BitString("1111010")
(self, char: str | None = None)
| 129 | ) |
| 130 | |
| 131 | def lstrip(self, char: str | None = None) -> BitString: |
| 132 | """Returns a copy of the BitString with leading characters removed. |
| 133 | |
| 134 | If omitted or None, 'chars' defaults '0':: |
| 135 | |
| 136 | BitString("00010101000").lstrip() == BitString("00010101") |
| 137 | BitString("11110101111").lstrip("1") == BitString("1111010") |
| 138 | """ |
| 139 | if char is None: |
| 140 | char = "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. |