开发者

Remove character from string

开发者 https://www.devze.com 2023-02-17 00:51 出处:网络
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\', \'\')

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

精彩评论

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