The new Waze Wiki, aka Wazeopedia, is now live at Wazeopedia.waze.com! While this legacy wiki will remain accessible for the time being, it is no longer updated by the community. For the most up-to-date guidance, please visit your local Wazeopedia.

Please do not make any more updates to these legacy wiki pages, all future updates should be made in your country's local Wazeopedia.

Clock over a larger globe

Template:Str left/doc

From waze
Jump to: navigation, search
This is a documentation subpage for Template:Str left.
It contains usage information, categories and other content that is not part of the original template page.

Contents

Usage

<code>{{Str left|<string>|<count>}}</code>

Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

Limitations

  • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
  • Inexpensive (uses no other templates).

Examples

  • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}
    This is a documentation subpage for Template:Str left.
    It contains usage information, categories and other content that is not part of the original template page.

    Usage

    <code>{{Str left|<string>|<count>}}</code>

    Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

    If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

    Limitations

    • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
    • Inexpensive (uses no other templates).

    Examples

    • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
    • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
    • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
    • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
    • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
    • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
    • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
      This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

    Examples of limitations

    All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

    The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

    • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
      This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
    • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
      This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
    • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
      The result is correct, as expected.
    • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
      This last example should be equivalent to the previous one, but it is not.

    The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

    • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
      It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
    • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
      It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
    • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
      It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
    • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

    On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

    • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
    • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

    Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

    • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

    Template data

    This is the TemplateData documentation for this template used by VisualEditor and other tools.

    Str left/doc

    <templatedata>
    {
            "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
            "params": {
                    "1": {
                            "label": "String",
                            "description": "The string to be trimmed and counted",
                            "type": "string",
                            "required": true
                    },
                    "2": {
                            "label": "Count",
                            "description": "Gives the <count> substring of characters from the start of the trimmed string",
                            "type": "number",
                            "required": true
                    }
            }
    }
    </templatedata>

    See also

    • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

    Template:Navbox string handling templates


    • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}
      This is a documentation subpage for Template:Str left.
      It contains usage information, categories and other content that is not part of the original template page.

      Usage

      <code>{{Str left|<string>|<count>}}</code>

      Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

      If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

      Limitations

      • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
      • Inexpensive (uses no other templates).

      Examples

      • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
      • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
      • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
      • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
      • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
      • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
      • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
        This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

      Examples of limitations

      All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

      The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

      • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
        This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
      • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
        This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
      • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
        The result is correct, as expected.
      • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
        This last example should be equivalent to the previous one, but it is not.

      The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

      • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
        It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
      • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
        It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
      • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
        It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
      • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

      On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

      • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
      • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

      Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

      • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

      Template data

      This is the TemplateData documentation for this template used by VisualEditor and other tools.

      Str left/doc

      <templatedata>
      {
              "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
              "params": {
                      "1": {
                              "label": "String",
                              "description": "The string to be trimmed and counted",
                              "type": "string",
                              "required": true
                      },
                      "2": {
                              "label": "Count",
                              "description": "Gives the <count> substring of characters from the start of the trimmed string",
                              "type": "number",
                              "required": true
                      }
              }
      }
      </templatedata>

      See also

      • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

      Template:Navbox string handling templates


      • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}
        This is a documentation subpage for Template:Str left.
        It contains usage information, categories and other content that is not part of the original template page.

        Usage

        <code>{{Str left|<string>|<count>}}</code>

        Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

        If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

        Limitations

        • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
        • Inexpensive (uses no other templates).

        Examples

        • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
        • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
        • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
        • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
        • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
        • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
        • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
          This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

        Examples of limitations

        All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

        The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

        • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
          This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
        • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
          This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
        • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
          The result is correct, as expected.
        • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
          This last example should be equivalent to the previous one, but it is not.

        The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

        • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
          It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
        • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
          It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
        • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
          It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
        • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

        On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

        • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
        • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

        Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

        • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

        Template data

        This is the TemplateData documentation for this template used by VisualEditor and other tools.

        Str left/doc

        <templatedata>
        {
                "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                "params": {
                        "1": {
                                "label": "String",
                                "description": "The string to be trimmed and counted",
                                "type": "string",
                                "required": true
                        },
                        "2": {
                                "label": "Count",
                                "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                "type": "number",
                                "required": true
                        }
                }
        }
        </templatedata>

        See also

        • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

        Template:Navbox string handling templates


        • {{ Str left/doc | Lorem ipsum dolor sit amet | }}
          This is a documentation subpage for Template:Str left.
          It contains usage information, categories and other content that is not part of the original template page.

          Usage

          <code>{{Str left|<string>|<count>}}</code>

          Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

          If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

          Limitations

          • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
          • Inexpensive (uses no other templates).

          Examples

          • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
          • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
          • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
          • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
          • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
          • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
          • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
            This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

          Examples of limitations

          All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

          The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

          • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
            This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
          • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
            This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
          • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
            The result is correct, as expected.
          • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
            This last example should be equivalent to the previous one, but it is not.

          The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

          • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
            It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
          • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
            It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
          • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
            It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
          • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

          On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

          • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
          • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

          Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

          • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

          Template data

          This is the TemplateData documentation for this template used by VisualEditor and other tools.

          Str left/doc

          <templatedata>
          {
                  "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                  "params": {
                          "1": {
                                  "label": "String",
                                  "description": "The string to be trimmed and counted",
                                  "type": "string",
                                  "required": true
                          },
                          "2": {
                                  "label": "Count",
                                  "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                  "type": "number",
                                  "required": true
                          }
                  }
          }
          </templatedata>

          See also

          • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

          Template:Navbox string handling templates


          • {{ Str left/doc | Lorem ipsum dolor sit amet }}
            This is a documentation subpage for Template:Str left.
            It contains usage information, categories and other content that is not part of the original template page.

            Usage

            <code>{{Str left|<string>|<count>}}</code>

            Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

            If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

            Limitations

            • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
            • Inexpensive (uses no other templates).

            Examples

            • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
            • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
            • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
            • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
            • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
            • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
            • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
              This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

            Examples of limitations

            All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

            The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

            • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
              This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
            • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
              This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
            • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
              The result is correct, as expected.
            • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
              This last example should be equivalent to the previous one, but it is not.

            The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

            • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
              It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
            • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
              It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
            • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
              It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
            • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

            On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

            • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
            • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

            Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

            • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

            Template data

            This is the TemplateData documentation for this template used by VisualEditor and other tools.

            Str left/doc

            <templatedata>
            {
                    "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                    "params": {
                            "1": {
                                    "label": "String",
                                    "description": "The string to be trimmed and counted",
                                    "type": "string",
                                    "required": true
                            },
                            "2": {
                                    "label": "Count",
                                    "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                    "type": "number",
                                    "required": true
                            }
                    }
            }
            </templatedata>

            See also

            • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

            Template:Navbox string handling templates


            • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}
              This is a documentation subpage for Template:Str left.
              It contains usage information, categories and other content that is not part of the original template page.

              Usage

              <code>{{Str left|<string>|<count>}}</code>

              Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

              If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

              Limitations

              • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
              • Inexpensive (uses no other templates).

              Examples

              • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
              • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
              • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
              • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
              • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
              • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
              • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

              Examples of limitations

              All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

              The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

              • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
              • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
              • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                The result is correct, as expected.
              • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                This last example should be equivalent to the previous one, but it is not.

              The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

              • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
              • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
              • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
              • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

              On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

              • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
              • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

              Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

              • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

              Template data

              This is the TemplateData documentation for this template used by VisualEditor and other tools.

              Str left/doc

              <templatedata>
              {
                      "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                      "params": {
                              "1": {
                                      "label": "String",
                                      "description": "The string to be trimmed and counted",
                                      "type": "string",
                                      "required": true
                              },
                              "2": {
                                      "label": "Count",
                                      "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                      "type": "number",
                                      "required": true
                              }
                      }
              }
              </templatedata>

              See also

              • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

              Template:Navbox string handling templates


              • {{ Str left/doc | àçé | 2 }}
                This is a documentation subpage for Template:Str left.
                It contains usage information, categories and other content that is not part of the original template page.

                Usage

                <code>{{Str left|<string>|<count>}}</code>

                Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                Limitations

                • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                • Inexpensive (uses no other templates).

                Examples

                • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                  This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                Examples of limitations

                All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                  This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                  This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                  The result is correct, as expected.
                • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                  This last example should be equivalent to the previous one, but it is not.

                The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                  It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                  It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                  It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                Template data

                This is the TemplateData documentation for this template used by VisualEditor and other tools.

                Str left/doc

                <templatedata>
                {
                        "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                        "params": {
                                "1": {
                                        "label": "String",
                                        "description": "The string to be trimmed and counted",
                                        "type": "string",
                                        "required": true
                                },
                                "2": {
                                        "label": "Count",
                                        "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                        "type": "number",
                                        "required": true
                                }
                        }
                }
                </templatedata>

                See also

                • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                Template:Navbox string handling templates


                • This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                Examples of limitations

                All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                • {{ Str left/doc | a&nbsp;c | 3 }}
                  This is a documentation subpage for Template:Str left.
                  It contains usage information, categories and other content that is not part of the original template page.

                  Usage

                  <code>{{Str left|<string>|<count>}}</code>

                  Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                  If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                  Limitations

                  • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                  • Inexpensive (uses no other templates).

                  Examples

                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                  • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                  • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                  • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                    This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                  Examples of limitations

                  All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                  The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                  • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                    This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                  • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                    This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                  • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                    The result is correct, as expected.
                  • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                    This last example should be equivalent to the previous one, but it is not.

                  The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                  • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                    It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                  • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                    It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                  • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                    It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                  • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                  On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                  • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                  • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                  Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                  • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                  Template data

                  This is the TemplateData documentation for this template used by VisualEditor and other tools.

                  Str left/doc

                  <templatedata>
                  {
                          "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                          "params": {
                                  "1": {
                                          "label": "String",
                                          "description": "The string to be trimmed and counted",
                                          "type": "string",
                                          "required": true
                                  },
                                  "2": {
                                          "label": "Count",
                                          "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                          "type": "number",
                                          "required": true
                                  }
                          }
                  }
                  </templatedata>

                  See also

                  • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                  Template:Navbox string handling templates


                  • This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                  • {{ Str left/doc | a&#66;c | 3 }}
                    This is a documentation subpage for Template:Str left.
                    It contains usage information, categories and other content that is not part of the original template page.

                    Usage

                    <code>{{Str left|<string>|<count>}}</code>

                    Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                    If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                    Limitations

                    • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                    • Inexpensive (uses no other templates).

                    Examples

                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                    • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                    • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                    • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                      This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                    Examples of limitations

                    All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                    The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                    • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                      This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                    • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                      This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                    • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                      The result is correct, as expected.
                    • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                      This last example should be equivalent to the previous one, but it is not.

                    The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                    • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                      It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                    • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                      It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                    • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                      It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                    • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                    On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                    • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                    • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                    Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                    • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                    Template data

                    This is the TemplateData documentation for this template used by VisualEditor and other tools.

                    Str left/doc

                    <templatedata>
                    {
                            "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                            "params": {
                                    "1": {
                                            "label": "String",
                                            "description": "The string to be trimmed and counted",
                                            "type": "string",
                                            "required": true
                                    },
                                    "2": {
                                            "label": "Count",
                                            "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                            "type": "number",
                                            "required": true
                                    }
                            }
                    }
                    </templatedata>

                    See also

                    • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                    Template:Navbox string handling templates


                    • This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                    • {{ Str left/doc | a c | 3 }}
                      This is a documentation subpage for Template:Str left.
                      It contains usage information, categories and other content that is not part of the original template page.

                      Usage

                      <code>{{Str left|<string>|<count>}}</code>

                      Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                      If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                      Limitations

                      • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                      • Inexpensive (uses no other templates).

                      Examples

                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                      • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                      • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                      • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                        This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                      Examples of limitations

                      All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                      The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                      • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                        This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                      • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                        This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                      • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                        The result is correct, as expected.
                      • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                        This last example should be equivalent to the previous one, but it is not.

                      The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                      • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                        It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                      • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                        It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                      • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                        It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                      • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                      On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                      • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                      • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                      Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                      • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                      Template data

                      This is the TemplateData documentation for this template used by VisualEditor and other tools.

                      Str left/doc

                      <templatedata>
                      {
                              "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                              "params": {
                                      "1": {
                                              "label": "String",
                                              "description": "The string to be trimmed and counted",
                                              "type": "string",
                                              "required": true
                                      },
                                      "2": {
                                              "label": "Count",
                                              "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                              "type": "number",
                                              "required": true
                                      }
                              }
                      }
                      </templatedata>

                      See also

                      • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                      Template:Navbox string handling templates


                      • The result is correct, as expected.
                      • {{ Str left/doc | a&#32;c | 3 }}
                        This is a documentation subpage for Template:Str left.
                        It contains usage information, categories and other content that is not part of the original template page.

                        Usage

                        <code>{{Str left|<string>|<count>}}</code>

                        Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                        If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                        Limitations

                        • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                        • Inexpensive (uses no other templates).

                        Examples

                        • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                        • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                        • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                        • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                        • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                        • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                        • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                          This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                        Examples of limitations

                        All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                        The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                        • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                          This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                        • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                          This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                        • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                          The result is correct, as expected.
                        • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                          This last example should be equivalent to the previous one, but it is not.

                        The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                        • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                          It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                        • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                          It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                        • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                          It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                        • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                        On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                        • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                        • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                        Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                        • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                        Template data

                        This is the TemplateData documentation for this template used by VisualEditor and other tools.

                        Str left/doc

                        <templatedata>
                        {
                                "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                "params": {
                                        "1": {
                                                "label": "String",
                                                "description": "The string to be trimmed and counted",
                                                "type": "string",
                                                "required": true
                                        },
                                        "2": {
                                                "label": "Count",
                                                "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                "type": "number",
                                                "required": true
                                        }
                                }
                        }
                        </templatedata>

                        See also

                        • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                        Template:Navbox string handling templates


                        • This last example should be equivalent to the previous one, but it is not.

                        The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                        • {{ Str left/doc | a<nowiki/>bc | 3 }}
                          This is a documentation subpage for Template:Str left.
                          It contains usage information, categories and other content that is not part of the original template page.

                          Usage

                          <code>{{Str left|<string>|<count>}}</code>

                          Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                          If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                          Limitations

                          • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                          • Inexpensive (uses no other templates).

                          Examples

                          • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                          • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                          • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                          • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                          • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                          • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                          • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                            This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                          Examples of limitations

                          All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                          The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                          • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                            This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                          • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                            This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                          • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                            The result is correct, as expected.
                          • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                            This last example should be equivalent to the previous one, but it is not.

                          The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                          • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                            It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                          • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                            It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                          • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                            It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                          • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                          On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                          • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                          • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                          Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                          • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                          Template data

                          This is the TemplateData documentation for this template used by VisualEditor and other tools.

                          Str left/doc

                          <templatedata>
                          {
                                  "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                  "params": {
                                          "1": {
                                                  "label": "String",
                                                  "description": "The string to be trimmed and counted",
                                                  "type": "string",
                                                  "required": true
                                          },
                                          "2": {
                                                  "label": "Count",
                                                  "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                  "type": "number",
                                                  "required": true
                                          }
                                  }
                          }
                          </templatedata>

                          See also

                          • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                          Template:Navbox string handling templates


                          • It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                          • {{ Str left/doc | a<nowiki/>bc | 43 }}
                            This is a documentation subpage for Template:Str left.
                            It contains usage information, categories and other content that is not part of the original template page.

                            Usage

                            <code>{{Str left|<string>|<count>}}</code>

                            Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                            If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                            Limitations

                            • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                            • Inexpensive (uses no other templates).

                            Examples

                            • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                            • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                            • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                            • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                            • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                            • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                            • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                              This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                            Examples of limitations

                            All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                            The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                            • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                              This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                            • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                              This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                            • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                              The result is correct, as expected.
                            • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                              This last example should be equivalent to the previous one, but it is not.

                            The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                            • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                              It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                            • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                              It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                            • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                              It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                            • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                            On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                            • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                            • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                            Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                            • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                            Template data

                            This is the TemplateData documentation for this template used by VisualEditor and other tools.

                            Str left/doc

                            <templatedata>
                            {
                                    "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                    "params": {
                                            "1": {
                                                    "label": "String",
                                                    "description": "The string to be trimmed and counted",
                                                    "type": "string",
                                                    "required": true
                                            },
                                            "2": {
                                                    "label": "Count",
                                                    "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                    "type": "number",
                                                    "required": true
                                            }
                                    }
                            }
                            </templatedata>

                            See also

                            • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                            Template:Navbox string handling templates


                            • It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                            • {{ Str left/doc | a<nowiki/>bc | 44 }}
                              This is a documentation subpage for Template:Str left.
                              It contains usage information, categories and other content that is not part of the original template page.

                              Usage

                              <code>{{Str left|<string>|<count>}}</code>

                              Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                              If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                              Limitations

                              • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                              • Inexpensive (uses no other templates).

                              Examples

                              • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                              • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                              • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                              • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                              • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                              • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                              • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                                This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                              Examples of limitations

                              All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                              The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                              • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                                This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                              • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                                This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                              • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                                The result is correct, as expected.
                              • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                                This last example should be equivalent to the previous one, but it is not.

                              The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                              • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                                It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                              • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                                It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                              • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                                It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                              • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                              On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                              • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                              • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                              Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                              • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                              Template data

                              This is the TemplateData documentation for this template used by VisualEditor and other tools.

                              Str left/doc

                              <templatedata>
                              {
                                      "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                      "params": {
                                              "1": {
                                                      "label": "String",
                                                      "description": "The string to be trimmed and counted",
                                                      "type": "string",
                                                      "required": true
                                              },
                                              "2": {
                                                      "label": "Count",
                                                      "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                      "type": "number",
                                                      "required": true
                                              }
                                      }
                              }
                              </templatedata>

                              See also

                              • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                              Template:Navbox string handling templates


                              • It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                              • {{ Str left/doc | a<nowiki/>bc | 45 }}
                                This is a documentation subpage for Template:Str left.
                                It contains usage information, categories and other content that is not part of the original template page.

                                Usage

                                <code>{{Str left|<string>|<count>}}</code>

                                Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                                If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                                Limitations

                                • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                                • Inexpensive (uses no other templates).

                                Examples

                                • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                                • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                                • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                                • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                                • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                                • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                                • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                                  This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                                Examples of limitations

                                All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                                The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                                • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                                  This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                                • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                                  This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                                • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                                  The result is correct, as expected.
                                • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                                  This last example should be equivalent to the previous one, but it is not.

                                The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                                • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                                  It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                                • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                                  It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                                • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                                  It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                                • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                                On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                                • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                                • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                                Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                                • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                                Template data

                                This is the TemplateData documentation for this template used by VisualEditor and other tools.

                                Str left/doc

                                <templatedata>
                                {
                                        "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                        "params": {
                                                "1": {
                                                        "label": "String",
                                                        "description": "The string to be trimmed and counted",
                                                        "type": "string",
                                                        "required": true
                                                },
                                                "2": {
                                                        "label": "Count",
                                                        "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                        "type": "number",
                                                        "required": true
                                                }
                                        }
                                }
                                </templatedata>

                                See also

                                • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                                Template:Navbox string handling templates


                                On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                                • {{ Str left/doc | a<noinclude/>bc | 3 }}
                                  This is a documentation subpage for Template:Str left.
                                  It contains usage information, categories and other content that is not part of the original template page.

                                  Usage

                                  <code>{{Str left|<string>|<count>}}</code>

                                  Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                                  If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                                  Limitations

                                  • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                                  • Inexpensive (uses no other templates).

                                  Examples

                                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                                  • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                                  • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                                  • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                                  • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                                    This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                                  Examples of limitations

                                  All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                                  The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                                  • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                                    This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                                  • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                                    This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                                  • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                                    The result is correct, as expected.
                                  • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                                    This last example should be equivalent to the previous one, but it is not.

                                  The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                                  • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                                    It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                                  • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                                    It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                                  • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                                    It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                                  • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                                  On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                                  • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                                  • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                                  Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                                  • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                                  Template data

                                  This is the TemplateData documentation for this template used by VisualEditor and other tools.

                                  Str left/doc

                                  <templatedata>
                                  {
                                          "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                          "params": {
                                                  "1": {
                                                          "label": "String",
                                                          "description": "The string to be trimmed and counted",
                                                          "type": "string",
                                                          "required": true
                                                  },
                                                  "2": {
                                                          "label": "Count",
                                                          "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                          "type": "number",
                                                          "required": true
                                                  }
                                          }
                                  }
                                  </templatedata>

                                  See also

                                  • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                                  Template:Navbox string handling templates


                                  • {{ Str left/doc | a<!-- comment -->bc | 3 }}
                                    This is a documentation subpage for Template:Str left.
                                    It contains usage information, categories and other content that is not part of the original template page.

                                    Usage

                                    <code>{{Str left|<string>|<count>}}</code>

                                    Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                                    If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                                    Limitations

                                    • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                                    • Inexpensive (uses no other templates).

                                    Examples

                                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                                    • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                                    • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                                    • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                                    • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                                      This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                                    Examples of limitations

                                    All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                                    The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                                    • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                                      This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                                    • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                                      This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                                    • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                                      The result is correct, as expected.
                                    • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                                      This last example should be equivalent to the previous one, but it is not.

                                    The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                                    • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                                      It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                                    • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                                      It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                                    • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                                      It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                                    • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                                    On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                                    • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                                    • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                                    Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                                    • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                                    Template data

                                    This is the TemplateData documentation for this template used by VisualEditor and other tools.

                                    Str left/doc

                                    <templatedata>
                                    {
                                            "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                            "params": {
                                                    "1": {
                                                            "label": "String",
                                                            "description": "The string to be trimmed and counted",
                                                            "type": "string",
                                                            "required": true
                                                    },
                                                    "2": {
                                                            "label": "Count",
                                                            "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                            "type": "number",
                                                            "required": true
                                                    }
                                            }
                                    }
                                    </templatedata>

                                    See also

                                    • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                                    Template:Navbox string handling templates


                                    Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                                    • {{ Str left/doc | Abc. | 10 }}
                                      This is a documentation subpage for Template:Str left.
                                      It contains usage information, categories and other content that is not part of the original template page.

                                      Usage

                                      <code>{{Str left|<string>|<count>}}</code>

                                      Gives the <count> substring of characters from the start of the trimmed string (the substring has length <count>).

                                      If <count> is invalid, empty or zero, an empty string is returned. If undefined, it defaults to 1.

                                      Limitations

                                      • Length to 500: The maximum substring stops at 500 long, yet gives no error message. Only 500 characters can be extracted even if the <string> is longer.
                                      • Inexpensive (uses no other templates).

                                      Examples

                                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 10 }}Template loop detected: Template:Str left/doc
                                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 1 }}Template loop detected: Template:Str left/doc
                                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 0 }}Template loop detected: Template:Str left/doc
                                      • {{ Str left/doc | Lorem ipsum dolor sit amet | }}Template loop detected: Template:Str left/doc
                                      • {{ Str left/doc | Lorem ipsum dolor sit amet }}Template loop detected: Template:Str left/doc
                                      • {{ Str left/doc | Lorem ipsum dolor sit amet | 40 }}Template loop detected: Template:Str left/doc
                                      • {{ Str left/doc | àçé | 2 }}Template loop detected: Template:Str left/doc
                                        This example is demonstrating the safety of this template with the UTF-8 encoding (this should work now) :

                                      Examples of limitations

                                      All the limitations of use for this template and shown below are caused by the current implementation of the {{padleft:}} parser function used in this template, which does not filter its third parameter containing the characters used for padding a string to the specified length (it currently counts incorrectly the characters to extract from the padding string, and incorrectly measures its effective length; in addition this parameter is limited to 500 bytes).

                                      The following examples are demonstrating that this template is not safe with character entity references found in its string parameter :

                                      • {{ Str left/doc | a&nbsp;c | 3 }}Template loop detected: Template:Str left/doc
                                        This should display "a c", but the named character entity was partially truncated, leaving no length available for the final "c".
                                      • {{ Str left/doc | a&#66;c | 3 }}Template loop detected: Template:Str left/doc
                                        This should display "abc", but the named character entity was partially truncated, leaving no length available for the final "c".
                                      • {{ Str left/doc | a c | 3 }}Template loop detected: Template:Str left/doc
                                        The result is correct, as expected.
                                      • {{ Str left/doc | a&#32;c | 3 }}Template loop detected: Template:Str left/doc
                                        This last example should be equivalent to the previous one, but it is not.

                                      The following example shows that the presence of some wiki markup that should be transparent and ignored, does not allow this template to work as expected (the nowiki section is replaced by a unique index string in the effective runtime value of the parameter; this unique (43-bytes long) string starts by a control character (which will be finally filtered out from the generated HTML page if it remains in the result of this template), followed by "UNIQ" and some unique sequence and terminated by "QINU" and a final control character; it is partially visible below, because the unique string is not complete after truncation, and then cannot be eliminated from the output in the first two lines):

                                      • {{ Str left/doc | a<nowiki/>bc | 3 }}Template loop detected: Template:Str left/doc
                                        It effectively returns 3 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here.
                                      • {{ Str left/doc | a<nowiki/>bc | 43 }}Template loop detected: Template:Str left/doc
                                        It effectively returns 43 bytes, but the \x07 (BELL) control in the second position is stripped out when generating the HTML displayed here, and the final \x07 was truncated
                                      • {{ Str left/doc | a<nowiki/>bc | 44 }}Template loop detected: Template:Str left/doc
                                        It effectively returns 44 bytes, but the complete 43-bytes sequence is filtered out from the output wiki code when generating the final HTML, so there just remains the first leading "a" character .
                                      • {{ Str left/doc | a<nowiki/>bc | 45 }}Template loop detected: Template:Str left/doc

                                      On the opposite, the HTML comments, and the "noinclude", "includeonly" and "onlyinclude" wiki markup tags are safe, because they are preprocessed in template parameters, before including it and substituting parameters:

                                      • {{ Str left/doc | a<noinclude/>bc | 3 }}Template loop detected: Template:Str left/doc
                                      • {{ Str left/doc | a<!-- comment -->bc | 3 }}Template loop detected: Template:Str left/doc

                                      Note also that the specified length will cause the input string to be padded by repeating it, if this length is larger than the input string length:

                                      • {{ Str left/doc | Abc. | 10 }}Template loop detected: Template:Str left/doc

                                      Template data

                                      This is the TemplateData documentation for this template used by VisualEditor and other tools.

                                      Str left/doc

                                      <templatedata>
                                      {
                                              "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                              "params": {
                                                      "1": {
                                                              "label": "String",
                                                              "description": "The string to be trimmed and counted",
                                                              "type": "string",
                                                              "required": true
                                                      },
                                                      "2": {
                                                              "label": "Count",
                                                              "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                              "type": "number",
                                                              "required": true
                                                      }
                                              }
                                      }
                                      </templatedata>

                                      See also

                                      • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                                      Template:Navbox string handling templates


                                      Template data

                                      This is the TemplateData documentation for this template used by VisualEditor and other tools.

                                      Str left/doc

                                      <templatedata>
                                      {
                                              "description": "A template to give the <count> substring of characters from the start of the trimmed string ",
                                              "params": {
                                                      "1": {
                                                              "label": "String",
                                                              "description": "The string to be trimmed and counted",
                                                              "type": "string",
                                                              "required": true
                                                      },
                                                      "2": {
                                                              "label": "Count",
                                                              "description": "Gives the <count> substring of characters from the start of the trimmed string",
                                                              "type": "number",
                                                              "required": true
                                                      }
                                              }
                                      }
                                      </templatedata>

                                      See also

                                      • Bugzilla:22555 - need for correcting padleft and padright functions, and to provide better string handling parser functions.

                                      Template:Navbox string handling templates