---
source: crates/ruff/src/rules/pylint/mod.rs
---
bad_str_strip_call.py:2:21: PLE1310 String `strip` call contains duplicate characters
  |
2 | # PLE1310
3 | "Hello World".strip("Hello")
  |                     ^^^^^^^ PLE1310
4 | 
5 | # PLE1310
  |

bad_str_strip_call.py:5:21: PLE1310 String `strip` call contains duplicate characters
  |
5 | # PLE1310
6 | "Hello World".strip("Hello")
  |                     ^^^^^^^ PLE1310
7 | 
8 | # PLE1310
  |

bad_str_strip_call.py:8:21: PLE1310 String `strip` call contains duplicate characters
   |
 8 | # PLE1310
 9 | "Hello World".strip(u"Hello")
   |                     ^^^^^^^^ PLE1310
10 | 
11 | # PLE1310
   |

bad_str_strip_call.py:11:21: PLE1310 String `strip` call contains duplicate characters
   |
11 | # PLE1310
12 | "Hello World".strip(r"Hello")
   |                     ^^^^^^^^ PLE1310
13 | 
14 | # PLE1310
   |

bad_str_strip_call.py:14:21: PLE1310 String `strip` call contains duplicate characters
   |
14 | # PLE1310
15 | "Hello World".strip("Hello\t")
   |                     ^^^^^^^^^ PLE1310
16 | 
17 | # PLE1310
   |

bad_str_strip_call.py:17:21: PLE1310 String `strip` call contains duplicate characters
   |
17 | # PLE1310
18 | "Hello World".strip(r"Hello\t")
   |                     ^^^^^^^^^^ PLE1310
19 | 
20 | # PLE1310
   |

bad_str_strip_call.py:20:21: PLE1310 String `strip` call contains duplicate characters
   |
20 | # PLE1310
21 | "Hello World".strip("Hello\\")
   |                     ^^^^^^^^^ PLE1310
22 | 
23 | # PLE1310
   |

bad_str_strip_call.py:23:21: PLE1310 String `strip` call contains duplicate characters
   |
23 | # PLE1310
24 | "Hello World".strip(r"Hello\\")
   |                     ^^^^^^^^^^ PLE1310
25 | 
26 | # PLE1310
   |

bad_str_strip_call.py:26:21: PLE1310 String `strip` call contains duplicate characters
   |
26 | # PLE1310
27 | "Hello World".strip("🤣🤣🤣🤣🙃👀😀")
   |                     ^^^^^^^^^^^^^^^^ PLE1310
28 | 
29 | # PLE1310
   |

bad_str_strip_call.py:30:5: PLE1310 String `strip` call contains duplicate characters
   |
30 |   # PLE1310
31 |   "Hello World".strip(
32 |       """
   |  _____^
33 | | there are a lot of characters to strip
34 | | """
   | |___^ PLE1310
35 |   )
   |

bad_str_strip_call.py:36:21: PLE1310 String `strip` call contains duplicate characters
   |
36 |   # PLE1310
37 |   "Hello World".strip("can we get a long " \
   |  _____________________^
38 | |                     "string of characters to strip " \
39 | |                     "please?")
   | |_____________________________^ PLE1310
40 |   
41 |   # PLE1310
   |

bad_str_strip_call.py:42:5: PLE1310 String `strip` call contains duplicate characters
   |
42 |   # PLE1310
43 |   "Hello World".strip(
44 |       "can we get a long "
   |  _____^
45 | |     "string of characters to strip "
46 | |     "please?"
   | |_____________^ PLE1310
47 |   )
   |

bad_str_strip_call.py:49:5: PLE1310 String `strip` call contains duplicate characters
   |
49 |   # PLE1310
50 |   "Hello World".strip(
51 |       "can \t we get a long"
   |  _____^
52 | |     "string \t of characters to strip"
53 | |     "please?"
   | |_____________^ PLE1310
54 |   )
   |

bad_str_strip_call.py:61:11: PLE1310 String `strip` call contains duplicate characters
   |
61 | # PLE1310
62 | u''.strip('http://')
   |           ^^^^^^^^^ PLE1310
63 | 
64 | # PLE1310
   |

bad_str_strip_call.py:64:12: PLE1310 String `lstrip` call contains duplicate characters (did you mean `removeprefix`?)
   |
64 | # PLE1310
65 | u''.lstrip('http://')
   |            ^^^^^^^^^ PLE1310
66 | 
67 | # PLE1310
   |

bad_str_strip_call.py:67:12: PLE1310 String `rstrip` call contains duplicate characters (did you mean `removesuffix`?)
   |
67 | # PLE1310
68 | b''.rstrip('http://')
   |            ^^^^^^^^^ PLE1310
69 | 
70 | # OK
   |


