Redigerer
Mal:Strfind short/dok
Hopp til navigering
Hopp til søk
Advarsel:
Du er ikke innlogget. IP-adressen din vil bli vist offentlig om du redigerer. Hvis du
logger inn
eller
oppretter en konto
vil redigeringene dine tilskrives brukernavnet ditt, og du vil få flere andre fordeler.
Antispamsjekk.
Ikke
fyll inn dette feltet!
{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> The '''[[Template:Strfind_short]]''' finds the location, in parameter {1} with length lenstr=15 (up to 99), of the string {2} with length {3}, using a simple, quick method. If the string is not found, the result is zero (0), indicating no match. The parameter lenstr can be shorter than the actual 1st string, to stop the search earlier (and faster). The template was designed to use only 5 levels of expansion depth, rather than 18 or more levels as in other string-searching templates. :'''Usage:''' {{'''strfind short'''|abcdef|bcd|3}} {{in5}} → {{str_find|abcdef|bcd|3}} ::: {{'''strfind short'''|123456789.|45|2}} → {{strfind short|123456789.|45|2}} ::: {{'''strfind short'''|x+2.437-6|2.43|4}} → {{strfind short|x+2.437-6|2.43|4}} ::: {{'''strfind short'''|:***abcd**|*ab| {{strlen_short|*ab}} }} → {{strfind short|:***abcd**|*ab| {{strlen_short|*ab}} }} If the length of the substring {2} is not known, or changes often, then the extra template {strlen_quick} can be used as: {{strlen_quick|{{{2}}} }}, to determine the length of string 2, quickly. ==Examples== The following are examples: :* {{strfind short|abcdef|bcd|3}} {{in5}} → {{strfind_short|abcdef|bcd|3}} :* {{strfind short|Fast Forward (film)|(|1}} {{in5}} → {{strfind_short|Fast Forward (film)|(|1}} :* {{strfind short|Fast Forward Longer (film)|(|1}} → {{strfind_short|Fast Forward Longer (film)|(|1}} :* {{strfind short|Fast Forward Longer (film)|(|1|lenstr=26}} → {{strfind_short|Fast Forward Longer (film)|(|1|lenstr=26}} :* {{strfind short|A Funny Thing Happened on the Way to the Forum (film)|(|1|lenstr=53}} → {{strfind_short|A Funny Thing Happened on the Way to the Forum (film)|(|1|lenstr=53}} ==Performance impact== The operation of Template:Strfind_short was designed to run 4x times faster than other string-search templates; however, it typically runs 20x times faster (or shorter) for strings up to 15 characters long. The post-expand include size averages about 300 bytes (rather than 6,000 bytes for other string-search templates). It can be used over 5,000 times per page (compared to only 350 times for other search templates). For strings over 50 long, it will use more resources, due to processing strings larger than other templates had allowed. ==See also== * {{tl|Str find}} - searches strings, but with expansion depth of 18 or more <includeonly> [[Kategori:Strengfunksjonsmaler|{{PAGENAME}}]] [[en:Template:Strfind_short]] [[sl:Predloga:Strfind short]] [[th:แม่แบบ:Strfind short]] </includeonly>
Redigeringsforklaring:
Merk at alle bidrag til Wikisida.no anses som frigitt under Creative Commons Navngivelse-DelPåSammeVilkår (se
Wikisida.no:Opphavsrett
for detaljer). Om du ikke vil at ditt materiale skal kunne redigeres og distribueres fritt må du ikke lagre det her.
Du lover oss også at du har skrevet teksten selv, eller kopiert den fra en kilde i offentlig eie eller en annen fri ressurs.
Ikke lagre opphavsrettsbeskyttet materiale uten tillatelse!
Avbryt
Redigeringshjelp
(åpnes i et nytt vindu)
Forhåndsvis en side som bruker denne malen
Denne siden er medlem av 1 skjult kategori:
Kategori:Sider hvor ekspansjonsdybden er overskredet
Navigasjonsmeny
Personlige verktøy
Ikke logget inn
Brukerdiskusjon
Bidrag
Opprett konto
Logg inn
Navnerom
Mal
Diskusjon
norsk bokmål
Visninger
Les
Rediger kilde
Vis historikk
Mer
Navigasjon
Forside
Siste endringer
Tilfeldig side
Hjelp til MediaWiki
Verktøy
Lenker hit
Relaterte endringer
Spesialsider
Sideinformasjon