Template:First character

From WikiAlpha
Jump to: navigation, search
The below content is licensed according to Creative Commons Attribution-ShareAlike License contrary to the public domain logo at the foot of the page. It originally appeared on http://en.wikipedia.org. The original article might still be accessible here. You may be able to find a list of the article's previous contributors on the talk page.
[edit] [purge] Template documentation
The below content is licensed according to Creative Commons Attribution-ShareAlike License contrary to the public domain logo at the foot of the page. It originally appeared on http://en.wikipedia.org. The original article might still be accessible here. You may be able to find a list of the article's previous contributors on the talk page.

Usage

  • {{First character|string}} -> s
  • {{First character|!string}} -> !
  • {{First character|$string}} -> $
  • {{First character|[string}} -> [
  • {{First character|]string}} -> ]
  • {{First character|-string}} -> -
  • {{First character|_string}} -> _
  • {{First character|{string}} -> {
  • {{First character|}string}} -> }


Issues

Does not cope well with =, #, :, * or ;

  • {{First character|=string}} ->
  • {{First character|#string}} ->
  • {{First character|:string}} ->
  • {{First character|;string}} ->
  • {{First character|*string}} ->

"=" can be worked around:

  • {{First character|1=string}} -> =

"#", ":", "*" and ";" do actually get computed and can be used in comparison tests.

The display problem seems to hinge on Template:Phab by which bug Mediawiki treats these as if they are commencing a new-line (possibly inserting a newline for that purpose) so that:

{{First character|#string}} Item 1

gives:


  1. Item 1