replace英 [rɪˈpleɪs]
vt.代替;取代;更换;替换;把…放回原处;使归位;

REPLACE(old text, start num, num chars, new text) 将一个字符串中的部分字符用另一字符串替换
- 函数公式:=REPLACE(文本,位置,长度,新文本)
- 文本:要替换部分字符的文本
- 位置:要替换的旧文本中字符的位置
- 长度:要替换的旧文本中字符的个数。
- 新文本:用来替换 文本 中原有字符的新文本。
实例一: 要求把123456中的123替换为xyz,动画演示效果如下:

实例二: 要求对用户的手机号中间4位进行隐藏显示,替换为****星号内容,就可以使用replace函数实现。

C2单元格公式内容为: =REPLACE(B2,4,4,"****")
|