机器翻译是我每天必不可少的工具,因为要批量翻译一些资料,在各个翻译引擎的页面上翻译,太慢了,所以我自己买了三家的翻译(google, baidu, tencent) api ,在调用 API 的过程中,发现百度翻译在使用体验上是最差的,他会删除换行的格式,删除自己翻译不了的特殊字符,我同时也把这些问题反馈给了百度翻译,因为我也在百度工作过,希望他们做的更好。
Here, s is the original or given string, old is the string that you want to replace. new is the which replaces the old, and n is the number of times the old replaced.
Note: If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string. If n < 0, there is no limit on the number of replacements.
Example 1: