Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

If it smells it's chemistry, if it crawls it's biology, if it doesn't work it's physics.


devel / comp.lang.python / str.replace() when str contains \

SubjectAuthor
o str.replace() when str contains \Bernard LEDRU

1
str.replace() when str contains \

<mailman.823.1667077900.20444.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=20081&group=comp.lang.python#20081

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: pyt...@bernardledru.be (Bernard LEDRU)
Newsgroups: comp.lang.python
Subject: str.replace() when str contains \
Date: Sat, 29 Oct 2022 20:21:46 +0200
Lines: 22
Message-ID: <mailman.823.1667077900.20444.python-list@python.org>
References: <74734ce6c4b19d8ad3bed4317b28da49@bernardledru.be>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de n4KbhjvwYSJjrGf0eRupJAaipcjTDBbkYi/ImIR9f7OQ==
Return-Path: <python@bernardledru.be>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'argument': 0.04;
'&gt;&gt;&gt;': 0.07; 'string': 0.07; 'subject:when': 0.07;
'from:addr:python': 0.09; 'given,': 0.16; 'received:10.108': 0.16;
'subject:() ': 0.16; 'subject:contains': 0.16; 'to:addr:python-
list': 0.20; 'skip:p 30': 0.23; 'old': 0.27; '>>>': 0.28; 'header
:User-Agent:1': 0.30; 'received:46': 0.32; 'count': 0.36;
'hello,': 0.40; 'best': 0.61; 'copy': 0.63; 'received:62': 0.64;
'bernard': 0.69; 'attention': 0.71; 'subject: \\': 0.84
User-Agent: Roundcube Webmail/1.4.13
X-Sender: python@bernardledru.be
X-Originating-IP: 62.235.219.109
X-Webmail-UserID: no-reply@bernardledru.be
X-Ovh-Tracer-Id: 8014718487497527979
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvgedrtdekgdduvdegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpeggfffhvffufgfkgihitgesrgdtjhertderjeenucfhrhhomhepuegvrhhnrghrugcunffgffftfgcuoehphihthhhonhessggvrhhnrghrughlvggurhhurdgsvgeqnecuggftrfgrthhtvghrnhepleehueduhfeutefgteetgfekhefggfevffejieeftdelgfffgfeghfeuteeffeehnecuffhomhgrihhnpehphihthhhonhdrohhrghenucfkphepuddvjedrtddrtddruddpiedvrddvfeehrddvudelrddutdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeophihthhhohhnsegsvghrnhgrrhgulhgvughruhdrsggvqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehphihthhhonhdqlhhishhtsehphihthhhonhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht
X-Mailman-Approved-At: Sat, 29 Oct 2022 17:11:39 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <74734ce6c4b19d8ad3bed4317b28da49@bernardledru.be>
 by: Bernard LEDRU - Sat, 29 Oct 2022 18:21 UTC

Hello,

https://docs.python.org/3/library/stdtypes.html#string-methods

str.replace(old, new[, count])ΒΆ
Return a copy of the string with all occurrences of substring old
replaced by new. If the optional argument count is given, only the first
count occurrences are replaced.

Attention when the string contains the escape character.

Consider :

>>> a="H:\2023"; print(a.replace("\\","/"))
H:3
>>> a="H:\a2023"; print(a.replace("\\","/"))
H:2023
>>> a="H:\_2023"; print(a.replace("\\","/"))
H:/_2023

Best regards,
Bernard LEDRU

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor