---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B005 Using `.strip()` with multi-character strings is misleading
 --> B005.py:4:1
  |
2 | s.strip(s)  # no warning
3 | s.strip("we")  # no warning
4 | s.strip(".facebook.com")  # warning
  | ^^^^^^^^^^^^^^^^^^^^^^^^
5 | s.strip("e")  # no warning
6 | s.strip("\n\t ")  # no warning
  |

B005 Using `.strip()` with multi-character strings is misleading
 --> B005.py:7:1
  |
5 | s.strip("e")  # no warning
6 | s.strip("\n\t ")  # no warning
7 | s.strip(r"\n\t ")  # warning
  | ^^^^^^^^^^^^^^^^^
8 | s.lstrip(s)  # no warning
9 | s.lstrip("we")  # no warning
  |

B005 Using `.strip()` with multi-character strings is misleading
  --> B005.py:10:1
   |
 8 | s.lstrip(s)  # no warning
 9 | s.lstrip("we")  # no warning
10 | s.lstrip(".facebook.com")  # warning
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
11 | s.lstrip("e")  # no warning
12 | s.lstrip("\n\t ")  # no warning
   |

B005 Using `.strip()` with multi-character strings is misleading
  --> B005.py:13:1
   |
11 | s.lstrip("e")  # no warning
12 | s.lstrip("\n\t ")  # no warning
13 | s.lstrip(r"\n\t ")  # warning
   | ^^^^^^^^^^^^^^^^^^
14 | s.rstrip(s)  # no warning
15 | s.rstrip("we")  # warning
   |

B005 Using `.strip()` with multi-character strings is misleading
  --> B005.py:16:1
   |
14 | s.rstrip(s)  # no warning
15 | s.rstrip("we")  # warning
16 | s.rstrip(".facebook.com")  # warning
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
17 | s.rstrip("e")  # no warning
18 | s.rstrip("\n\t ")  # no warning
   |

B005 Using `.strip()` with multi-character strings is misleading
  --> B005.py:19:1
   |
17 | s.rstrip("e")  # no warning
18 | s.rstrip("\n\t ")  # no warning
19 | s.rstrip(r"\n\t ")  # warning
   | ^^^^^^^^^^^^^^^^^^
20 | s.strip("a")  # no warning
21 | s.strip("あ")  # no warning
   |

B005 Using `.strip()` with multi-character strings is misleading
  --> B005.py:22:1
   |
20 | s.strip("a")  # no warning
21 | s.strip("あ")  # no warning
22 | s.strip("ああ")  # warning
   | ^^^^^^^^^^^^^^^
23 | s.strip("\ufeff")  # no warning
24 | s.strip("\u0074\u0065\u0073\u0074")  # warning
   |

B005 Using `.strip()` with multi-character strings is misleading
  --> B005.py:24:1
   |
22 | s.strip("ああ")  # warning
23 | s.strip("\ufeff")  # no warning
24 | s.strip("\u0074\u0065\u0073\u0074")  # warning
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 |
26 | from somewhere import other_type, strip
   |
