Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 05:29, 22 February 2025 by Prd (talk | contribs) (Created page with "{{Documentation subpage}} {{lua|Module:String}} {{Subst only|auto=yes}} ==Usage== Converts the first ASCII letter character of a string to lowercase. This behavior is different from the magic word lcfirst, which affects the first character of a string regardless of whether it is a letter or not. ==Examples== {{demo inline|<nowiki>{{lcfirstletter|Test}}</nowiki>}} {{demo inline|<nowiki>{{lcfirstletter|(Test)}}</nowiki>}} {{demo inline|<nowiki>{{lc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Usage

Converts the first ASCII letter character of a string to lowercase. This behavior is different from the magic word lcfirst, which affects the first character of a string regardless of whether it is a letter or not.

Examples

{{lcfirstletter|Test}} → {{subst:#invoke:String|match|Test|%A*}}{{subst:lc:{{subst:#invoke:String|sub|{{subst:#invoke:String|match|Test|%a.*}}|1|1}}}}{{subst:#invoke:String|sub|{{subst:#invoke:String|match|Test|%a.*}}|2}}

{{lcfirstletter|(Test)}} → {{subst:#invoke:String|match|(Test)|%A*}}{{subst:lc:{{subst:#invoke:String|sub|{{subst:#invoke:String|match|(Test)|%a.*}}|1|1}}}}{{subst:#invoke:String|sub|{{subst:#invoke:String|match|(Test)|%a.*}}|2}}

{{lcfirstletter|6Th century}} → {{subst:#invoke:String|match|6Th century|%A*}}{{subst:lc:{{subst:#invoke:String|sub|{{subst:#invoke:String|match|6Th century|%a.*}}|1|1}}}}{{subst:#invoke:String|sub|{{subst:#invoke:String|match|6Th century|%a.*}}|2}}

(compare to {{ucfirst:6Th century}} → 6Th century)

See also