Posts by Lordepina • 31 points
1 post
-
0
votes1
answer154
viewsQ: How to hyphenate between string characters
Separating the characters of a string with a Python hyphen works perfectly this way: import re regex = r"\B(?=(.{1}))" test_str = "Pêssego" subst = "-" result = re.sub(regex, subst, test_str, 0) if…