Skip to content

引入

ts
import { getMentionRtx } from 't-comm';

// 不支持 tree-shaking 的项目
import { getMentionRtx} from 't-comm/lib/rtx/index';

// 只支持 ESM 的项目
import { getMentionRtx} from 't-comm/es/rtx/index';

getMentionRtx(rawStr)

描述:获取 rtx 拼接的提及字符串

参数

参数名描述
rawStr原始字符串,比如 foo,bar

返回: 处理后的字符串,比如 <@foo><@bar>

示例

ts
getMentionRtx('foo,bar');   // '<@foo><@bar>'
getMentionRtx('foo;bar');   // '<@foo><@bar>'
getMentionRtx('foo');       // '<@foo>'
getMentionRtx('');          // ''