Ways to slice a string?

后端 未结 6 651
渐次进展
渐次进展 2020-12-01 21:16

I have a string, example:

s = \"this is a string, a\"

Where a \',\' (comma) will always be the 3rd to the last character, aka

6条回答
  •  情书的邮戳
    2020-12-01 22:22

    Python strings are immutable. This means that you must create at least 1 new string in order to remove the comma, as opposed to editing the string in place in a language like C.

提交回复
热议问题