📌  相关文章
📜  字符串中最后一次出现的 python 索引 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:15.858000             🧑  作者: Mango

代码示例2
original_string = "sentence one. sentence two. sentence three"

last_char_index = original_string.rfind(".")
new_string = original_string[:last_char_index] + "," + original_string
print(new_string)
"sentence one. sententce two, sentence three"