टेम्पलेट:Strloc insert
{{{1{{{2}}}}}}
टेम्पलेट बिबरनलेख[देखीं] [संपादन करीं] [इतिहास देखीं] [रिफ्रेश करीं]
The string-inserter Template:Strloc_insert inserts a string into another string at a specified location, or appends it at the end.
Usage
संपादन करीं- {{Strloc insert|<string1>|strloc=<n>|<string2>}}
Returns string1 with string2 inserted at location strloc=n, where n=1 denotes the start of the string (prepending). If strloc <= 0 then string2 is appended at the end of string1. The parameter strloc can be a math formula, such as: strloc={{{len}}}-2, or strloc=abs(-2*5)+6.
Examples
संपादन करींThe following show various uses:
- {{Strloc insert|abcdef|strloc=4|ZZZ}} → abcZZZdef
- {{Strloc insert|123456|strloc=1|++}} → ++123456
- {{Strloc insert|Abcd|strloc=0 |EFG}} → AbcdEFG
- {{Strloc insert|<i>Out of Africa (film)|strloc=17|</i>}} → Out of Africa(film)
- {{Strloc insert|[[Out of Africa (film)|<i>Out of Africa (film)]]|strloc=17+20|</i>}} → Out of Africa (film)
- Note, the example wikilinking "Out of Africa" inserted "</i>" as end-italics,
but with strloc=17+20 to skip farther in the "[[ ]]" wikilink string.
- {{Strloc insert|<i>Cosmos (book)|strloc={{strfind_short|Cosmos (book)|(|1}}|</i>}} → Cosmos (book)
- In the example with "Cosmos (book)" the number for strloc was set by finding "(" in the
title. If there had been no "(" then the result would append "</i>" at the end of the title.
Limitations
संपादन करींThe text at the end (after string2) is subject to the limitations of Template:Str_right. Spaces around the inserted string are limited to 1 space, before or after:
- {{Strloc insert|[[J. Oppenheimer]]|strloc=6 |Robert }} → J. Robert Oppenheimer
Spaces beyond the inserted string might be encoded as " " rather than being real spaces.
See also
संपादन करींपरिचय खातिर ऊपर दिहल गइल बिबरनलेख के टेम्पलेट:Strloc insert/doc से ट्रांसक्लूड क के इहाँ देखावल जा रहल बाटे। (संपादन करीं | इतिहास देखीं) संपादक लोग एह टेम्पलेट के अभ्यासपन्ना (सैंडबाक्स) (बनाईं | मिरर करीं) आ टेस्टकेस (बनाईं) पन्ना सभ पर अभ्यास आ प्रयोग (टेस्टिंग) क सकत बाटे। अनुरोध बा कि अगर श्रेणी जोड़े के होखे तब /doc उपपन्ना (सबपेज) पर जोड़ल जाय। एह टेम्पलेट के उपपन्ना (सबपेज) देखीं। |