开发者

Remove character from string

i have one variable $serviceName = "ZSM开发者_如何学运维eter". i have to remove "S" from this string and get "ZMeter". how i can solve it. thanks in advance.


translate($serviceName, 'S', '')


concat(
    substring($serviceName, 1, 1),
    substring($serviceName, 3)
    )


pardon my xsl... but hope it ll help

<xsl:variable name="frst" select="substring-before($serviceName,'S')" /> <xsl:variable name="after" select="substring-after($serviceName,'S')" /> <xsl:variable name=serviceName select="concat($frst,$after)" />


replace($serviceName, '^ZSMeter$', 'ZMeter') in case you're with XSLT 2.0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜