小写字符串的第一个字符,仅使用 xslt 1.0 [英] lower case the first character of a string using only xslt 1.0
本文介绍了小写字符串的第一个字符,仅使用 xslt 1.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我见过 模式 用于使用翻译功能将字符串翻译成小写(或大写),适用于使用 xslt 1.0 的人.
I have seen patterns for translating a string into lower (or upper case) using the translate function for folks stuck using xslt 1.0.
有没有一种优雅的方法可以让字符串的第一个字母小写?
Is there a elegant way of just making the first letter of a string lowercase?
TestCase => testCase
推荐答案
例如,如果您的字符串位于名为 name
的属性中:
If your string were, for example, in an attribute called name
:
<xsl:value-of select="concat(translate(substring(@name, 1, 1), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), substring(@name, 2))"/>
这篇关于小写字符串的第一个字符,仅使用 xslt 1.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文