Пређи на садржај

Шаблон:Trim

Iz Vojne Enciklopedije


Документација шаблона[прикажи] [уреди] [историја] [освежи]

{{#ifeq:trim |док

    | 

{{#ifeq:show |show

|
        }}{{#if: |
         |   {{#ifexist:Шаблон:Trim
                  | [[Категорија:Документација {{#switch:Шаблон |Шаблон=шаблона |Модул=модула |Корисник=корисничких страница |#default=Википедије}}]]
                  | 
                 }}
        }}
    | 
   }}

This template trims whitespace from a string. The string should be passed as the first unnamed parameter. You may substitute this template - that is, if used as {{subst:trim{{#ifeq:+|-||{{{2}}}}}{{#ifeq:+|-||{{{3}}}}}{{#ifeq:+|-||{{{4}}}}}{{#ifeq:+|-||{{{5}}}}}{{#ifeq:+|-||{{{6}}}}}{{#ifeq:+|-||{{{7}}}}}{{#ifeq:+|-||{{{8}}}}}{{#ifeq:+|-||{{{9}}}}}{{#ifeq:+|-||{{{10}}}}}{{#ifeq:+|-||..}}}}, the resulting wikicode is "clean".

Usage

{{trim|text}} = text with any leading or trailing whitespace removed.

Example

  • "{{{{#if: |замени:}}trim{{#if: abc || abc}}{{#if: ||{{{3}}}}}{{#if: ||{{{4}}}}}{{#if: ||{{{5}}}}}{{#if: ||{{{6}}}}}{{#if: ||{{{7}}}}}{{#if: ||{{{8}}}}}{{#if: ||{{{9}}}}}{{#if: ||{{{10}}}}}{{#if: ||{{{11}}}}}{{#if: ||{{{12}}}}}{{#if: ||{{{13}}}}}{{#if: ||{{{14}}}}}{{#if: ||{{{15}}}}}{{#if: ||{{{16}}}}}{{#if: ||{{{17}}}}}{{#if: ||{{{18}}}}}{{#if: ||{{{19}}}}}{{#if: ||{{{20}}}}}{{#if: ||...}}}}" produces "{{ safesubst:#if:1| abc}}"

Template data

{{#if:|погледајте месечни извештај о грешкама за овај шаблон.|Ово је {{#if:|TemplateData|TemplateData}} документација за овај шаблон, коришћена у Визуелном уређивачу и у другим алаткама; погледајте месечни извештај о грешкама за овај шаблон.}}

TemplateData за Trim

{{#ifeq:Trim|sandbox||

}} <templatedata> {

       "description": "The template trims whitespace from a string.",
       "params": {
               "1": {
                       "label": "String",
                       "description": "The string to be trimmed of whitespace",
                       "type": "string",
                       "required": true
               }
       }

} </templatedata>

See also