CINXE.COM
Modul:StringReplace - Wikipedia, den frie encyklopædi
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="da" dir="ltr"> <head> <meta charset="UTF-8"> <title>Modul:StringReplace - Wikipedia, den frie encyklopædi</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )dawikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":[",\t.",".\t,"],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],"wgRequestId":"0f78c89c-8171-4515-b4df-6c9f42f2c788","wgCanonicalNamespace":"Module","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":828,"wgPageName":"Modul:StringReplace","wgTitle":"StringReplace","wgCurRevisionId":11752092,"wgRevisionId":11752092,"wgArticleId":753613,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Wikipedia skabelon-beskyttede moduler","Ukategoriserede moduler","Moduler uden tilstrækkelig vejledning"],"wgPageViewLanguage":"da","wgPageContentLanguage":"da","wgPageContentModel":"Scribunto","wgRelevantPageName":"Modul:StringReplace","wgRelevantArticleId":753613,"wgTempUserName":null,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["templateeditor"],"wgRestrictionMove":["templateeditor"], "wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":1000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q13382852","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false, "wgSiteNoticeId":"2.0"};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready","ext.dismissableSiteNotice.styles":"ready"};RLPAGEMODULES=["ext.pygments.view","site","mediawiki.page.ready","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.NewSection","ext.gadget.ReferenceTooltips","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming", "ext.uls.interface","ext.cx.eventlogging.campaigns","wikibase.client.vector-2022","ext.checkUser.clientHints","wikibase.sidebar.tracking","ext.dismissableSiteNotice"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=da&modules=ext.dismissableSiteNotice.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=da&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=da&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Modul:StringReplace - Wikipedia, den frie encyklopædi"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//da.m.wikipedia.org/wiki/Modul:StringReplace"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (da)"> <link rel="EditURI" type="application/rsd+xml" href="//da.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://da.wikipedia.org/wiki/Modul:StringReplace"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.da"> <link rel="alternate" type="application/atom+xml" title="Wikipedia Atom-feed" href="/w/index.php?title=Speciel:Seneste_%C3%A6ndringer&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-828 ns-subject page-Modul_StringReplace rootpage-Modul_StringReplace skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Spring til indhold</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Websted"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Hovedmenu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Hovedmenu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Hovedmenu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">flyt til sidebjælken</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">skjul</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage" class="mw-list-item"><a href="/wiki/Forside" title="Besøg forsiden [z]" accesskey="z"><span>Forside</span></a></li><li id="n-kategorier" class="mw-list-item"><a href="/wiki/Wikipedia:Kategorier"><span>Kategorier</span></a></li><li id="n-Fremhævet-indhold" class="mw-list-item"><a href="/wiki/Wikipedia:Fremh%C3%A6vet_indhold"><span>Fremhævet indhold</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Speciel:Tilf%C3%A6ldig_side" title="Gå til en tilfældig side [x]" accesskey="x"><span>Tilfældig side</span></a></li><li id="n-Tilfældige-artikler" class="mw-list-item"><a href="/wiki/Wikipedia:Tilf%C3%A6ldige_artikler"><span>Tilfældige artikler</span></a></li><li id="n-Aktuelt" class="mw-list-item"><a href="/wiki/Wikipedia:Aktuelle_begivenheder"><span>Aktuelt</span></a></li> </ul> </div> </div> <div id="p-deltagelse" class="vector-menu mw-portlet mw-portlet-deltagelse" > <div class="vector-menu-heading"> deltagelse </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-velkommen" class="mw-list-item"><a href="/wiki/Hj%C3%A6lp:Velkommen_til_Wikipedia"><span>Velkommen</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedia:Forside" title="Om projektet, hvad du kan gøre, hvor tingene findes"><span>Skribentforside</span></a></li><li id="n-Landsbybrønden" class="mw-list-item"><a href="/wiki/Wikipedia:Landsbybr%C3%B8nden"><span>Landsbybrønden</span></a></li><li id="n-Projekter" class="mw-list-item"><a href="/wiki/Wikipedia:Projekter"><span>Projekter</span></a></li><li id="n-Portaler" class="mw-list-item"><a href="/wiki/Portal:Portaler"><span>Portaler</span></a></li><li id="n-Ønskede-artikler" class="mw-list-item"><a href="/wiki/Wikipedia:WikiProjekt_Efterspurgte_artikler"><span>Ønskede artikler</span></a></li><li id="n-Oprydning" class="mw-list-item"><a href="/wiki/Wikipedia:Oprydning"><span>Oprydning</span></a></li><li id="n-Kalender" class="mw-list-item"><a href="/wiki/Wikipedia:Kalender"><span>Kalender</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Speciel:Seneste_%C3%A6ndringer" title="Listen over de seneste ændringer i wikien. [r]" accesskey="r"><span>Seneste ændringer</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/Hj%C3%A6lp:Forside" title="Stedet hvor du finder hjælp"><span>Hjælp</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Forside" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedia" src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" style="width: 7.5em; height: 1.125em;"> <img class="mw-logo-tagline" alt="Den frie encyklopædi" src="/static/images/mobile/copyright/wikipedia-tagline-da.svg" width="120" height="13" style="width: 7.5em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Speciel:S%C3%B8gning" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Søg på Wikipedia [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Søg</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Søg på Wikipedia" aria-label="Søg på Wikipedia" autocapitalize="sentences" title="Søg på Wikipedia [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Speciel:Søgning"> </div> <button class="cdx-button cdx-search-input__end-button">Søg</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personlige værktøjer"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Udseende"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Skift udseendet af sidens skriftstørrelse, -bredde og -farve" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Udseende" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Udseende</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_da.wikipedia.org&uselang=da" class=""><span>Donation</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Speciel:Opret_konto&returnto=Modul%3AStringReplace" title="Du opfordres til at oprette en konto og logge på, men det er ikke obligatorisk" class=""><span>Opret konto</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Speciel:Log_p%C3%A5&returnto=Modul%3AStringReplace" title="Du opfordres til at logge på, men det er ikke obligatorisk. [o]" accesskey="o" class=""><span>Log på</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out user-links-collapsible-item" title="Flere muligheder" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personlige værktøjer" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personlige værktøjer</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Brugermenu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_da.wikipedia.org&uselang=da"><span>Donation</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Speciel:Opret_konto&returnto=Modul%3AStringReplace" title="Du opfordres til at oprette en konto og logge på, men det er ikke obligatorisk"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Opret konto</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Speciel:Log_p%C3%A5&returnto=Modul%3AStringReplace" title="Du opfordres til at logge på, men det er ikke obligatorisk. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log på</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><div id="mw-dismissablenotice-anonplace"></div><script>(function(){var node=document.getElementById("mw-dismissablenotice-anonplace");if(node){node.outerHTML="\u003Cdiv class=\"mw-dismissable-notice\"\u003E\u003Cdiv class=\"mw-dismissable-notice-close\"\u003E[\u003Ca tabindex=\"0\" role=\"button\"\u003ELuk\u003C/a\u003E]\u003C/div\u003E\u003Cdiv class=\"mw-dismissable-notice-body\"\u003E\u003C!-- CentralNotice --\u003E\u003Cdiv id=\"localNotice\" data-nosnippet=\"\"\u003E\u003Cdiv class=\"sitenotice\" lang=\"da\" dir=\"ltr\"\u003E\u003Cp\u003EDu kan være med til at gøre Wikipedia bedre – \u003Ca href=\"/wiki/Hj%C3%A6lp:Du_kan_v%C3%A6re_med_til_at_g%C3%B8re_Wikipedia_bedre!\" title=\"Hjælp:Du kan være med til at gøre Wikipedia bedre!\"\u003Elæs her hvordan!\u003C/a\u003E\u003Cbr /\u003E \u003C/p\u003E\u003Cdiv class=\"vis-for-autopatrol\"\u003EDansk Wikipedia har en Discord-server, hvor du kan chatte. Se mere på \u003Ca href=\"/wiki/Wikipedia:Discord\" title=\"Wikipedia:Discord\"\u003EWikipedia:Discord\u003C/a\u003E\u003C/div\u003E\u003Cp\u003E\u003Ci\u003E\u003Csmall\u003E(\u003Ca href=\"/wiki/Hj%C3%A6lp:Sitenotice\" title=\"Hjælp:Sitenotice\"\u003ELæs her om sitenotice\u003C/a\u003E)\u003C/small\u003E\u003C/i\u003E\u003C/p\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E";}}());</script></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Websted"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Indhold" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Indhold</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">flyt til sidebjælken</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">skjul</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Indledning</div> </a> </li> <li id="toc-Usage" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Usage"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Usage</span> </div> </a> <ul id="toc-Usage-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Indhold" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Vis/skjul indholdsfortegnelsen" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Vis/skjul indholdsfortegnelsen</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Modul</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">StringReplace</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Gå til en artikel på et andet sprog. Tilgængelig på 36 sprog" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-36" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">36 sprog</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-af mw-list-item"><a href="https://af.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – afrikaans" lang="af" hreflang="af" data-title="Module:StringReplace" data-language-autonym="Afrikaans" data-language-local-name="afrikaans" class="interlanguage-link-target"><span>Afrikaans</span></a></li><li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D9%88%D8%AD%D8%AF%D8%A9:StringReplace" title="وحدة:StringReplace – arabisk" lang="ar" hreflang="ar" data-title="وحدة:StringReplace" data-language-autonym="العربية" data-language-local-name="arabisk" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-bcl mw-list-item"><a href="https://bcl.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – Central Bikol" lang="bcl" hreflang="bcl" data-title="Module:StringReplace" data-language-autonym="Bikol Central" data-language-local-name="Central Bikol" class="interlanguage-link-target"><span>Bikol Central</span></a></li><li class="interlanguage-link interwiki-bg mw-list-item"><a href="https://bg.wikipedia.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB:StringReplace" title="Модул:StringReplace – bulgarsk" lang="bg" hreflang="bg" data-title="Модул:StringReplace" data-language-autonym="Български" data-language-local-name="bulgarsk" class="interlanguage-link-target"><span>Български</span></a></li><li class="interlanguage-link interwiki-bh mw-list-item"><a href="https://bh.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – Bhojpuri" lang="bh" hreflang="bh" data-title="Module:StringReplace" data-language-autonym="भोजपुरी" data-language-local-name="Bhojpuri" class="interlanguage-link-target"><span>भोजपुरी</span></a></li><li class="interlanguage-link interwiki-ckb mw-list-item"><a href="https://ckb.wikipedia.org/wiki/%D9%85%DB%86%D8%AF%DB%8C%D9%88%D9%88%D9%84:StringReplace" title="مۆدیوول:StringReplace – sorani" lang="ckb" hreflang="ckb" data-title="مۆدیوول:StringReplace" data-language-autonym="کوردی" data-language-local-name="sorani" class="interlanguage-link-target"><span>کوردی</span></a></li><li class="interlanguage-link interwiki-diq mw-list-item"><a href="https://diq.wikipedia.org/wiki/Modul:StringReplace" title="Modul:StringReplace – Zazaki" lang="diq" hreflang="diq" data-title="Modul:StringReplace" data-language-autonym="Zazaki" data-language-local-name="Zazaki" class="interlanguage-link-target"><span>Zazaki</span></a></li><li class="interlanguage-link interwiki-dty mw-list-item"><a href="https://dty.wikipedia.org/wiki/%E0%A4%AE%E0%A5%8B%E0%A4%A1%E0%A5%8D%E0%A4%AF%E0%A5%81%E0%A4%B2:StringReplace" title="मोड्युल:StringReplace – Doteli" lang="dty" hreflang="dty" data-title="मोड्युल:StringReplace" data-language-autonym="डोटेली" data-language-local-name="Doteli" class="interlanguage-link-target"><span>डोटेली</span></a></li><li class="interlanguage-link interwiki-el mw-list-item"><a href="https://el.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – græsk" lang="el" hreflang="el" data-title="Module:StringReplace" data-language-autonym="Ελληνικά" data-language-local-name="græsk" class="interlanguage-link-target"><span>Ελληνικά</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D9%BE%D9%88%D8%AF%D9%85%D8%A7%D9%86:StringReplace" title="پودمان:StringReplace – persisk" lang="fa" hreflang="fa" data-title="پودمان:StringReplace" data-language-autonym="فارسی" data-language-local-name="persisk" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/Moduuli:StringReplace" title="Moduuli:StringReplace – finsk" lang="fi" hreflang="fi" data-title="Moduuli:StringReplace" data-language-autonym="Suomi" data-language-local-name="finsk" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-gom mw-list-item"><a href="https://gom.wikipedia.org/wiki/%E0%A4%8F%E0%A4%95%E0%A4%95:StringReplace" title="एकक:StringReplace – Goan Konkani" lang="gom" hreflang="gom" data-title="एकक:StringReplace" data-language-autonym="गोंयची कोंकणी / Gõychi Konknni" data-language-local-name="Goan Konkani" class="interlanguage-link-target"><span>गोंयची कोंकणी / Gõychi Konknni</span></a></li><li class="interlanguage-link interwiki-gu mw-list-item"><a href="https://gu.wikipedia.org/wiki/%E0%AA%B5%E0%AA%BF%E0%AA%AD%E0%AA%BE%E0%AA%97:StringReplace" title="વિભાગ:StringReplace – gujarati" lang="gu" hreflang="gu" data-title="વિભાગ:StringReplace" data-language-autonym="ગુજરાતી" data-language-local-name="gujarati" class="interlanguage-link-target"><span>ગુજરાતી</span></a></li><li class="interlanguage-link interwiki-kn mw-list-item"><a href="https://kn.wikipedia.org/wiki/%E0%B2%AE%E0%B2%BE%E0%B2%A1%E0%B3%8D%E0%B2%AF%E0%B3%82%E0%B2%B2%E0%B3%8D:StringReplace" title="ಮಾಡ್ಯೂಲ್:StringReplace – kannada" lang="kn" hreflang="kn" data-title="ಮಾಡ್ಯೂಲ್:StringReplace" data-language-autonym="ಕನ್ನಡ" data-language-local-name="kannada" class="interlanguage-link-target"><span>ಕನ್ನಡ</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EB%AA%A8%EB%93%88:StringReplace" title="모듈:StringReplace – koreansk" lang="ko" hreflang="ko" data-title="모듈:StringReplace" data-language-autonym="한국어" data-language-local-name="koreansk" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-lv mw-list-item"><a href="https://lv.wikipedia.org/wiki/Modulis:StringReplace" title="Modulis:StringReplace – lettisk" lang="lv" hreflang="lv" data-title="Modulis:StringReplace" data-language-autonym="Latviešu" data-language-local-name="lettisk" class="interlanguage-link-target"><span>Latviešu</span></a></li><li class="interlanguage-link interwiki-mai mw-list-item"><a href="https://mai.wikipedia.org/wiki/%E0%A4%AE%E0%A5%8B%E0%A4%A1%E0%A5%8D%E0%A4%AF%E0%A5%81%E0%A4%B2:StringReplace" title="मोड्युल:StringReplace – maithili" lang="mai" hreflang="mai" data-title="मोड्युल:StringReplace" data-language-autonym="मैथिली" data-language-local-name="maithili" class="interlanguage-link-target"><span>मैथिली</span></a></li><li class="interlanguage-link interwiki-mk mw-list-item"><a href="https://mk.wikipedia.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB:StringReplace" title="Модул:StringReplace – makedonsk" lang="mk" hreflang="mk" data-title="Модул:StringReplace" data-language-autonym="Македонски" data-language-local-name="makedonsk" class="interlanguage-link-target"><span>Македонски</span></a></li><li class="interlanguage-link interwiki-my mw-list-item"><a href="https://my.wikipedia.org/wiki/%E1%80%99%E1%80%B1%E1%80%AC%E1%80%BA%E1%80%82%E1%80%BB%E1%80%B0%E1%80%B8:StringReplace" title="မော်ဂျူး:StringReplace – burmesisk" lang="my" hreflang="my" data-title="မော်ဂျူး:StringReplace" data-language-autonym="မြန်မာဘာသာ" data-language-local-name="burmesisk" class="interlanguage-link-target"><span>မြန်မာဘာသာ</span></a></li><li class="interlanguage-link interwiki-nds-nl mw-list-item"><a href="https://nds-nl.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – plattysk (Holland)" lang="nds-NL" hreflang="nds-NL" data-title="Module:StringReplace" data-language-autonym="Nedersaksies" data-language-local-name="plattysk (Holland)" class="interlanguage-link-target"><span>Nedersaksies</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – nederlandsk" lang="nl" hreflang="nl" data-title="Module:StringReplace" data-language-autonym="Nederlands" data-language-local-name="nederlandsk" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-or mw-list-item"><a href="https://or.wikipedia.org/wiki/%E0%AC%AE%E0%AC%A1%E0%AD%8D%E0%AD%9F%E0%AD%81%E0%AC%B2:StringReplace" title="ମଡ୍ୟୁଲ:StringReplace – oriya" lang="or" hreflang="or" data-title="ମଡ୍ୟୁଲ:StringReplace" data-language-autonym="ଓଡ଼ିଆ" data-language-local-name="oriya" class="interlanguage-link-target"><span>ଓଡ଼ିଆ</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/M%C3%B3dulo:StringReplace" title="Módulo:StringReplace – portugisisk" lang="pt" hreflang="pt" data-title="Módulo:StringReplace" data-language-autonym="Português" data-language-local-name="portugisisk" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-sco mw-list-item"><a href="https://sco.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – skotsk" lang="sco" hreflang="sco" data-title="Module:StringReplace" data-language-autonym="Scots" data-language-local-name="skotsk" class="interlanguage-link-target"><span>Scots</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – Simple English" lang="en-simple" hreflang="en-simple" data-title="Module:StringReplace" data-language-autonym="Simple English" data-language-local-name="Simple English" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sn mw-list-item"><a href="https://sn.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – shona" lang="sn" hreflang="sn" data-title="Module:StringReplace" data-language-autonym="ChiShona" data-language-local-name="shona" class="interlanguage-link-target"><span>ChiShona</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB:StringReplace" title="Модул:StringReplace – serbisk" lang="sr" hreflang="sr" data-title="Модул:StringReplace" data-language-autonym="Српски / srpski" data-language-local-name="serbisk" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-szy mw-list-item"><a href="https://szy.wikipedia.org/wiki/bacu-saupu:StringReplace" title="bacu-saupu:StringReplace – Sakizaya" lang="szy" hreflang="szy" data-title="bacu-saupu:StringReplace" data-language-autonym="Sakizaya" data-language-local-name="Sakizaya" class="interlanguage-link-target"><span>Sakizaya</span></a></li><li class="interlanguage-link interwiki-ta mw-list-item"><a href="https://ta.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – tamil" lang="ta" hreflang="ta" data-title="Module:StringReplace" data-language-autonym="தமிழ்" data-language-local-name="tamil" class="interlanguage-link-target"><span>தமிழ்</span></a></li><li class="interlanguage-link interwiki-th mw-list-item"><a href="https://th.wikipedia.org/wiki/%E0%B8%A1%E0%B8%AD%E0%B8%94%E0%B8%B9%E0%B8%A5:StringReplace" title="มอดูล:StringReplace – thai" lang="th" hreflang="th" data-title="มอดูล:StringReplace" data-language-autonym="ไทย" data-language-local-name="thai" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-tum mw-list-item"><a href="https://tum.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – tumbuka" lang="tum" hreflang="tum" data-title="Module:StringReplace" data-language-autonym="ChiTumbuka" data-language-local-name="tumbuka" class="interlanguage-link-target"><span>ChiTumbuka</span></a></li><li class="interlanguage-link interwiki-ur mw-list-item"><a href="https://ur.wikipedia.org/wiki/%D9%85%D8%A7%DA%88%DB%8C%D9%88%D9%84:StringReplace" title="ماڈیول:StringReplace – urdu" lang="ur" hreflang="ur" data-title="ماڈیول:StringReplace" data-language-autonym="اردو" data-language-local-name="urdu" class="interlanguage-link-target"><span>اردو</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/M%C3%B4_%C4%91un:StringReplace" title="Mô đun:StringReplace – vietnamesisk" lang="vi" hreflang="vi" data-title="Mô đun:StringReplace" data-language-autonym="Tiếng Việt" data-language-local-name="vietnamesisk" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-wuu mw-list-item"><a href="https://wuu.wikipedia.org/wiki/%E6%A8%A1%E5%9D%97:StringReplace" title="模块:StringReplace – wu-kinesisk" lang="wuu" hreflang="wuu" data-title="模块:StringReplace" data-language-autonym="吴语" data-language-local-name="wu-kinesisk" class="interlanguage-link-target"><span>吴语</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/Module:StringReplace" title="Module:StringReplace – kinesisk" lang="zh" hreflang="zh" data-title="Module:StringReplace" data-language-autonym="中文" data-language-local-name="kinesisk" class="interlanguage-link-target"><span>中文</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/%E6%A8%A1%E7%B5%84:StringReplace" title="模組:StringReplace – kantonesisk" lang="yue" hreflang="yue" data-title="模組:StringReplace" data-language-autonym="粵語" data-language-local-name="kantonesisk" class="interlanguage-link-target"><span>粵語</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q13382852#sitelinks-wikipedia" title="Redigér sproglinks" class="wbc-editpage">Redigér links</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Navnerum"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-module" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Modul:StringReplace" title="View the module page [c]" accesskey="c"><span>Modul</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Moduldiskussion:StringReplace&action=edit&redlink=1" rel="discussion" class="new" title="Diskussion om indholdet på siden (ikke skrevet endnu) [t]" accesskey="t"><span>Diskussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Ændr sprogvariant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Visninger"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Modul:StringReplace"><span>Læs</span></a></li><li id="ca-viewsource" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Modul:StringReplace&action=edit" title="Denne side er beskyttet. Du kan se kildeteksten. [e]" accesskey="e"><span>Vis kilde</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Modul:StringReplace&action=history" title="Tidligere versioner af denne side [h]" accesskey="h"><span>Se historik</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Sideværktøjer"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Værktøjer" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Værktøjer</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Værktøjer</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">flyt til sidebjælken</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">skjul</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Flere muligheder" > <div class="vector-menu-heading"> Handlinger </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Modul:StringReplace"><span>Læs</span></a></li><li id="ca-more-viewsource" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Modul:StringReplace&action=edit"><span>Vis kilde</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Modul:StringReplace&action=history"><span>Se historik</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> Generelt </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Speciel:Hvad_linker_hertil/Modul:StringReplace" title="Liste med alle sider som henviser hertil [j]" accesskey="j"><span>Hvad henviser hertil</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Speciel:Relaterede_%C3%A6ndringer/Modul:StringReplace" rel="nofollow" title="Seneste ændringer af sider som denne side henviser til [k]" accesskey="k"><span>Beslægtede ændringer</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=da&campaign=dk" title="Upload filer [u]" accesskey="u"><span>Upload fil</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Speciel:Specialsider" title="Liste over alle specialsider [q]" accesskey="q"><span>Specialsider</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Modul:StringReplace&oldid=11752092" title="Permanent link til denne version af denne side"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Modul:StringReplace&action=info" title="Yderligere oplysninger om denne side"><span>Sideinformation</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Speciel:UrlShortener&url=https%3A%2F%2Fda.wikipedia.org%2Fwiki%2FModul%3AStringReplace"><span>Hent forkortet URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Speciel:QrCode&url=https%3A%2F%2Fda.wikipedia.org%2Fwiki%2FModul%3AStringReplace"><span>Download QR-kode</span></a></li> </ul> </div> </div> <div id="p-Organisation" class="vector-menu mw-portlet mw-portlet-Organisation" > <div class="vector-menu-heading"> Organisation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-contact" class="mw-list-item"><a href="/wiki/Wikipedia:Kontakt_Wikipedia"><span>Kontakt Wikipedia</span></a></li><li id="n-Wikimedia-Danmark" class="mw-list-item"><a href="https://dk.wikimedia.org/wiki/"><span>Wikimedia Danmark</span></a></li><li id="n-GLAM" class="mw-list-item"><a href="/wiki/Wikipedia:GLAM"><span>GLAM</span></a></li> </ul> </div> </div> <div id="p-electronpdfservice-sidebar-portlet-heading" class="vector-menu mw-portlet mw-portlet-electronpdfservice-sidebar-portlet-heading" > <div class="vector-menu-heading"> Udskriv/eksporter </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="electron-print_pdf" class="mw-list-item"><a href="/w/index.php?title=Speciel:DownloadAsPdf&page=Modul%3AStringReplace&action=show-download-screen"><span>Hent som PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="javascript:print();" rel="alternate" title="Printervenlig udgave af denne side [p]" accesskey="p"><span>Udskriftsvenlig udgave</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> I andre projekter </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q13382852" title="Link til tilknyttet emne i Wikidata [g]" accesskey="g"><span>Wikidata-element</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Sideværktøjer"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Udseende"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Udseende</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">flyt til sidebjælken</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">skjul</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> <div id="mw-indicator-pp-default" class="mw-indicator"><div class="mw-parser-output"><span typeof="mw:File"><a href="/wiki/Wikipedia:Beskyttelser#Skabelon" title="Denne modul er skabelon-beskyttet."><img alt="Page skabelon-beskyttet" src="//upload.wikimedia.org/wikipedia/commons/thumb/5/53/Template-protection-shackle.svg/20px-Template-protection-shackle.svg.png" decoding="async" width="20" height="20" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/53/Template-protection-shackle.svg/30px-Template-protection-shackle.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/53/Template-protection-shackle.svg/40px-Template-protection-shackle.svg.png 2x" data-file-width="512" data-file-height="512" /></a></span></div></div> </div> <div id="siteSub" class="noprint">Fra Wikipedia, den frie encyklopædi</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="da" dir="ltr"><style data-mw-deduplicate="TemplateStyles:r11851837">.mw-parser-output .documentation,.mw-parser-output .documentation-metadata{border:1px solid #a2a9b1;background-color:#ecfcf4;clear:both}.mw-parser-output .documentation{margin:1em 0 0 0;padding:1em}.mw-parser-output .documentation-metadata{margin:0.2em 0;font-style:italic;padding:0.4em 1em}.mw-parser-output .documentation-startbox{padding-bottom:3px;border-bottom:1px solid #aaa;margin-bottom:1ex}.mw-parser-output .documentation-heading{font-weight:bold;font-size:125%}.mw-parser-output .documentation-clear{clear:both}.mw-parser-output .documentation-toolbar{font-style:normal;font-size:85%}@media screen{html.skin-theme-clientpref-night .mw-parser-output .documentation,html.skin-theme-clientpref-night .mw-parser-output .documentation-metadata{background-color:#0b1e1c}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .documentation,html.skin-theme-clientpref-os .mw-parser-output .documentation-metadata{background-color:#0b1e1c}}</style><div class="documentation-container" role="complementary" aria-labelledby="documentation-heading"> <div class="documentation"> <div class="documentation-startbox"> <span class="documentation-heading" id="documentation-heading"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png" decoding="async" width="50" height="22" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/75px-Test_Template_Info-Icon_-_Version_%282%29.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/100px-Test_Template_Info-Icon_-_Version_%282%29.svg.png 2x" data-file-width="1792" data-file-height="800" /></span></span> Moduldokumentation</span><span class="mw-editsection-like plainlinks">[<a href="/wiki/Modul:StringReplace/dok" title="Modul:StringReplace/dok">vis</a>] [<a href="/wiki/Speciel:EditPage/Modul:StringReplace/dok" title="Speciel:EditPage/Modul:StringReplace/dok">redigér</a>] [<a href="/wiki/Speciel:PageHistory/Modul:StringReplace/dok" title="Speciel:PageHistory/Modul:StringReplace/dok">historik</a>] [<a href="/wiki/Speciel:Purge/Modul:StringReplace" title="Speciel:Purge/Modul:StringReplace">opfrisk</a>]</span></div> <p>{{<a href="/w/index.php?title=Skabelon:Module_rating&action=edit&redlink=1" class="new" title="Skabelon:Module rating (ikke skrevet endnu)">Module rating </a>|}} </p> <table class="plainlinks ombox ombox-content" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><span><img alt="Warning" src="//upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Ambox_warning_orange.svg/40px-Ambox_warning_orange.svg.png" decoding="async" width="40" height="34" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Ambox_warning_orange.svg/60px-Ambox_warning_orange.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Ambox_warning_orange.svg/80px-Ambox_warning_orange.svg.png 2x" data-file-width="378" data-file-height="326" /></span></span></td><td class="mbox-text"><b>Dette Lua-modul bruges på <a class="external text" href="https://linkcount.toolforge.org/index.php?project=da.wikipedia.org&page=Modul%3AStringReplace">ca. 74.400 sider, eller omkring 8% af alle sider</a></b>.<br /> For at undgå store forstyrrelser og unødvendigt pres på serverne, bør alle ændringer af skabelonen først afprøves i dens tilhørende modulets <a href="/w/index.php?title=Modul:StringReplace/sandkasse&action=edit&redlink=1" class="new" title="Modul:StringReplace/sandkasse (ikke skrevet endnu)">/sandkasse</a> eller <a href="/w/index.php?title=Modul:StringReplace/testcases&action=edit&redlink=1" class="new" title="Modul:StringReplace/testcases (ikke skrevet endnu)">/test</a>-undersider, eller i din egen <a href="/wiki/Modul:Sandkasse" title="Modul:Sandkasse">module sandkasse</a>. De færdigafprøvede ændringer kan derefter overføres til denne side ved en enkelt redigering. Du bør også overveje at diskutere ændringer på <a href="/w/index.php?title=Moduldiskussion:StringReplace&action=edit&redlink=1" class="new" title="Moduldiskussion:StringReplace (ikke skrevet endnu)">diskussionssiden</a> før du implementerer dem.</td></tr></tbody></table><style data-mw-deduplicate="TemplateStyles:r11752169">.mw-parser-output th.mbox-text,.mw-parser-output td.mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output td.mbox-image{border:none;padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output td.mbox-imageright{border:none;padding:2px 0.9em 2px 0;text-align:center}.mw-parser-output td.mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output table.ambox{margin:0 10%;border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output table.ambox+table.ambox{margin-top:-1px}.mw-parser-output .ambox th.mbox-text,.mw-parser-output .ambox td.mbox-text{padding:0.25em 0.5em}.mw-parser-output .ambox td.mbox-image{padding:2px 0 2px 0.5em}.mw-parser-output .ambox td.mbox-imageright{padding:2px 0.5em 2px 0}.mw-parser-output table.ambox-notice{border-left:10px solid #36c}.mw-parser-output table.ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output table.ambox-delete{border-left:10px solid #b32424}.mw-parser-output table.ambox-content{border-left:10px solid #f28500}.mw-parser-output table.ambox-style{border-left:10px solid #fc3}.mw-parser-output table.ambox-move{border-left:10px solid #9932cc}.mw-parser-output table.ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output table.imbox{margin:4px 10%;border-collapse:collapse;border:3px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .imbox .mbox-text .imbox{margin:0 -0.5em;display:block}.mw-parser-output .mbox-inside .imbox{margin:4px}.mw-parser-output table.imbox-notice{border:3px solid #36c}.mw-parser-output table.imbox-speedy{border:3px solid #b32424;background-color:#fee7e6}.mw-parser-output table.imbox-delete{border:3px solid #b32424}.mw-parser-output table.imbox-content{border:3px solid #f28500}.mw-parser-output table.imbox-style{border:3px solid #fc3}.mw-parser-output table.imbox-move{border:3px solid #9932cc}.mw-parser-output table.imbox-protection{border:3px solid #a2a9b1}.mw-parser-output table.imbox-license{border:3px solid #88a;background-color:#f7f8ff}.mw-parser-output table.imbox-featured{border:3px solid #cba135}.mw-parser-output table.cmbox{margin:3px 10%;border-collapse:collapse;border:1px solid #a2a9b1;background-color:#dfe8ff;box-sizing:border-box}.mw-parser-output table.cmbox-notice{background-color:#d8e8ff}.mw-parser-output table.cmbox-speedy{margin-top:4px;margin-bottom:4px;border:4px solid #b32424;background-color:#ffdbdb}.mw-parser-output table.cmbox-delete{background-color:#ffdbdb}.mw-parser-output table.cmbox-content{background-color:#ffe7ce}.mw-parser-output table.cmbox-style{background-color:#fff9db}.mw-parser-output table.cmbox-move{background-color:#e4d8ff}.mw-parser-output table.cmbox-protection{background-color:#efefe1}.mw-parser-output table.ombox{margin:4px 10%;border-collapse:collapse;border:1px solid #a2a9b1;background-color:#f8f9fa;box-sizing:border-box}.mw-parser-output table.ombox-notice{border:1px solid #a2a9b1}.mw-parser-output table.ombox-speedy{border:2px solid #b32424;background-color:#fee7e6}.mw-parser-output table.ombox-delete{border:2px solid #b32424}.mw-parser-output table.ombox-content{border:1px solid #f28500}.mw-parser-output table.ombox-style{border:1px solid #fc3}.mw-parser-output table.ombox-move{border:1px solid #9932cc}.mw-parser-output table.ombox-protection{border:2px solid #a2a9b1}.mw-parser-output table.tmbox{margin:4px 10%;border-collapse:collapse;border:1px solid #c0c090;background-color:#f8eaba;min-width:80%;box-sizing:border-box}.mw-parser-output .tmbox.mbox-small{min-width:0}.mw-parser-output .mediawiki .mbox-inside .tmbox{margin:2px 0;width:100%}.mw-parser-output .mbox-inside .tmbox.mbox-small{line-height:1.5em;font-size:100%}.mw-parser-output table.tmbox-speedy{border:2px solid #b32424;background-color:#fee7e6}.mw-parser-output table.tmbox-delete{border:2px solid #b32424}.mw-parser-output table.tmbox-content{border:2px solid #f28500}.mw-parser-output table.tmbox-style{border:2px solid #fc3}.mw-parser-output table.tmbox-move{border:2px solid #9932cc}.mw-parser-output table.tmbox-protection,.mw-parser-output table.tmbox-notice{border:1px solid #c0c090}.mw-parser-output table.fmbox{clear:both;margin:0.2em 0;width:100%;border:1px solid #a2a9b1;background-color:#f8f9fa;box-sizing:border-box}.mw-parser-output table.fmbox-system{background-color:#f8f9fa}.mw-parser-output table.fmbox-warning{border:1px solid #bb7070;background-color:#ffdbdb}.mw-parser-output table.fmbox-editnotice{background-color:transparent}.mw-parser-output div.mw-warning-with-logexcerpt,.mw-parser-output div.mw-lag-warn-high,.mw-parser-output div.mw-cascadeprotectedwarning,.mw-parser-output div/**/#mw-protect-cascadeon,.mw-parser-output div.titleblacklist-warning,.mw-parser-output div.locked-warning{clear:both;margin:0.2em 0;border:1px solid #bb7070;background-color:#ffdbdb;padding:0.25em 0.9em;box-sizing:border-box}html body.mediawiki .mw-parser-output .mbox-small{clear:right;float:right;margin:4px 0 4px 1em;box-sizing:border-box;width:238px;font-size:88%;line-height:1.25em}html body.mediawiki .mw-parser-output .mbox-small-left{margin:4px 1em 4px 0;box-sizing:border-box;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .compact-ambox table .mbox-image,.mw-parser-output .compact-ambox table .mbox-imageright,.mw-parser-output .compact-ambox table .mbox-empty-cell{display:none}.mw-parser-output .compact-ambox table.ambox{border:none;border-collapse:collapse;background-color:transparent;margin:0 0 0 1.6em!important;padding:0!important;width:auto;display:block}body.mediawiki .mw-parser-output .compact-ambox table.mbox-small-left{font-size:100%;width:auto;margin:0}.mw-parser-output .compact-ambox table .mbox-text{padding:0;margin:0}.mw-parser-output .compact-ambox table .mbox-text-span{display:list-item;line-height:1.5em;list-style-type:square}.mw-parser-output .skin-vector .compact-ambox table .mbox-text-span{list-style-type:disc}.mw-parser-output .compact-ambox .hide-when-compact{display:none}.mw-parser-output .template-documentation{clear:both;margin:1em 0 0 0;border:1px solid #aaa;background-color:#ecfcf4;padding:1em}</style> <table class="" style="width: 80%; float: none; margin: 0 auto; border-collapse: collapse; background: #FBFBFB; border: 1px solid #aaa; border-left: 10px solid #ff901e;padding: 0.25em 0.5em;"> <tbody><tr><td style="padding: 0.25em 0.5em;"><span class="metadata"><span typeof="mw:File"><a href="/wiki/Fil:Ambox_notice.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/c/c8/Ambox_notice.png/35px-Ambox_notice.png" decoding="async" width="35" height="35" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/c/c8/Ambox_notice.png 1.5x" data-file-width="40" data-file-height="40" /></a></span></span></td><td style="width:100%"><b>Utilstrækkelig vejledning</b><br /><div style="font-size:85%;line-height:135%;">Dette modul bør have en (bedre) vejledning, helst med eksempler på anvendelse.<br />Hvis andre moduler er nyere og/eller bedre, bør der henvises til dem.</div></td></tr></tbody></table> <div class="mw-heading mw-heading2"><h2 id="Usage">Usage</h2></div> <p><code>{{#invoke:StringReplace|<i>function_name</i>}}</code> </p> <table class="" style="width: 80%; float: none; margin: 0 auto; border-collapse: collapse; background: #FBFBFB; border: 1px solid #aaa; border-left: 10px solid #ff901e;padding: 0.25em 0.5em;"> <tbody><tr><td style="padding: 0.25em 0.5em;"><span class="metadata"><span typeof="mw:File"><a href="/wiki/Fil:Gnome-fs-directory.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Gnome-fs-directory.svg/35px-Gnome-fs-directory.svg.png" decoding="async" width="35" height="35" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Gnome-fs-directory.svg/53px-Gnome-fs-directory.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Gnome-fs-directory.svg/70px-Gnome-fs-directory.svg.png 2x" data-file-width="64" data-file-height="64" /></a></span></span></td><td style="width:100%"><b>Kategori mangler</b><br /><div style="font-size:85%;line-height:135%;">Dette modul hører til i en eller flere <b><a href="/wiki/Wikipedia:Kategorier" title="Wikipedia:Kategorier">kategorier</a></b>. <a href="/wiki/Hj%C3%A6lp:Kategorier" title="Hjælp:Kategorier">Kategoriser</a> venligst dette modul ved at placere den sammen med lignende emner. Fjern skabelonen efter kategorisering. Bemærk, at kategorier påsat via skabeloner, samt meget generelle kategorier ikke bør betragtes som tilstrækkelige.</div></td></tr></tbody></table> <div class="documentation-clear"></div> </div> <div role="note" class="documentation-metadata plainlinks"><a href="/wiki/Wikipedia:Skabelondokumentation" title="Wikipedia:Skabelondokumentation">Dokumentationen</a> ovenfor er <a href="/wiki/Wikipedia:Transklusion" title="Wikipedia:Transklusion">transkluderet</a> fra <a href="/wiki/Modul:StringReplace/dok" title="Modul:StringReplace/dok">Modul:StringReplace/dok</a>. <span class="documentation-toolbar">(<a href="/wiki/Speciel:EditPage/Modul:StringReplace/dok" title="Speciel:EditPage/Modul:StringReplace/dok">redigér</a> | <a href="/wiki/Speciel:PageHistory/Modul:StringReplace/dok" title="Speciel:PageHistory/Modul:StringReplace/dok">historik</a>)</span><br />Brugere kan eksperimentere i dette moduls undersider sandkasse <span class="documentation-toolbar">(<a class="external text" href="https://da.wikipedia.org/w/index.php?title=Modul:StringReplace/sandkasse&action=edit&preload=Skabelon%3ADokumentation%2Fpreload-module-sandkasse">opret</a> | <a class="external text" href="https://da.wikipedia.org/w/index.php?title=Modul:StringReplace/sandkasse&preload=Modul%3AStringReplace&action=edit&summary=Opret+en+sandkasseudgave+af+%5B%5BModul%3AStringReplace%5D%5D">kopiér</a>)</span> og testcases <span class="documentation-toolbar">(<a class="external text" href="https://da.wikipedia.org/w/index.php?title=Modul:StringReplace/testcases&action=edit&preload=Skabelon%3ADokumentation%2Fpreload-module-testcases">opret</a>)</span>.<br /> <a href="/wiki/Speciel:Pr%C3%A6fiksindeks/Modul:StringReplace/" title="Speciel:Præfiksindeks/Modul:StringReplace/">Undersider til dette modul</a>.</div></div> <p><span id="code"></span> </p><div class="mw-highlight mw-highlight-lang-lua mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos" data-line="1"></span></a><span class="c1">-- Module for different search and replace operations on strings.</span> </span><span id="L-2"><a href="#L-2"><span class="linenos" data-line="2"></span></a><span class="kd">local</span> <span class="n">p</span> <span class="o">=</span> <span class="p">{}</span> </span><span id="L-3"><a href="#L-3"><span class="linenos" data-line="3"></span></a> </span><span id="L-4"><a href="#L-4"><span class="linenos" data-line="4"></span></a><span class="c1">-- Takes one string parameter, and returns the string with all characters with special meaning for Lua patterns escaped with a preceding `%`.</span> </span><span id="L-5"><a href="#L-5"><span class="linenos" data-line="5"></span></a><span class="kr">function</span> <span class="nc">p</span><span class="p">.</span><span class="nf">escape_pattern</span><span class="p">(</span><span class="n">text</span><span class="p">)</span> </span><span id="L-6"><a href="#L-6"><span class="linenos" data-line="6"></span></a> <span class="c1">-- Replaces each occurence of any of ().%+-*?[^$ with a `%` and then the character.</span> </span><span id="L-7"><a href="#L-7"><span class="linenos" data-line="7"></span></a> <span class="kd">local</span> <span class="n">r</span> <span class="o">=</span> <span class="nb">string.gsub</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="s2">"[%(%)%.%%%+%-%*%?%[%^%$]"</span><span class="p">,</span> <span class="s2">"%%%1"</span><span class="p">)</span> </span><span id="L-8"><a href="#L-8"><span class="linenos" data-line="8"></span></a> <span class="kr">return</span> <span class="n">r</span> </span><span id="L-9"><a href="#L-9"><span class="linenos" data-line="9"></span></a><span class="kr">end</span> </span><span id="L-10"><a href="#L-10"><span class="linenos" data-line="10"></span></a> </span><span id="L-11"><a href="#L-11"><span class="linenos" data-line="11"></span></a><span class="c1">-- Returns the first parameter, with all occurences of the second parameter replaced with the third parameter.</span> </span><span id="L-12"><a href="#L-12"><span class="linenos" data-line="12"></span></a><span class="c1">-- All special characters are ignored: {{#invoke:StringReplace|replace_all|test.a%1$foo|%1|bar}} results in `test.abarfoo`.</span> </span><span id="L-13"><a href="#L-13"><span class="linenos" data-line="13"></span></a><span class="kr">function</span> <span class="nc">p</span><span class="p">.</span><span class="nf">replace_all</span><span class="p">(</span><span class="n">frame</span><span class="p">)</span> </span><span id="L-14"><a href="#L-14"><span class="linenos" data-line="14"></span></a> <span class="kd">local</span> <span class="n">str</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> </span><span id="L-15"><a href="#L-15"><span class="linenos" data-line="15"></span></a> <span class="kd">local</span> <span class="n">strToFind</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> </span><span id="L-16"><a href="#L-16"><span class="linenos" data-line="16"></span></a> <span class="kd">local</span> <span class="n">strToreplaceWith</span> <span class="o">=</span> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> </span><span id="L-17"><a href="#L-17"><span class="linenos" data-line="17"></span></a> <span class="kd">local</span> <span class="n">r</span> <span class="o">=</span> <span class="nb">string.gsub</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="n">p</span><span class="p">.</span><span class="n">escape_pattern</span><span class="p">(</span><span class="n">strToFind</span><span class="p">),</span> <span class="n">p</span><span class="p">.</span><span class="n">escape_pattern</span><span class="p">(</span><span class="n">strToreplaceWith</span><span class="p">))</span> </span><span id="L-18"><a href="#L-18"><span class="linenos" data-line="18"></span></a> <span class="kr">return</span> <span class="n">r</span> </span><span id="L-19"><a href="#L-19"><span class="linenos" data-line="19"></span></a><span class="kr">end</span> </span><span id="L-20"><a href="#L-20"><span class="linenos" data-line="20"></span></a> </span><span id="L-21"><a href="#L-21"><span class="linenos" data-line="21"></span></a><span class="n">p</span><span class="p">[</span><span class="s1">'encode wiki page name'</span><span class="p">]</span> <span class="o">=</span> <span class="kr">function</span><span class="p">(</span> <span class="n">frame</span> <span class="p">)</span> </span><span id="L-22"><a href="#L-22"><span class="linenos" data-line="22"></span></a> <span class="kd">local</span> <span class="n">x</span> <span class="o">=</span> <span class="n">mw</span><span class="p">.</span><span class="n">ustring</span><span class="p">.</span><span class="n">gsub</span><span class="p">(</span> </span><span id="L-23"><a href="#L-23"><span class="linenos" data-line="23"></span></a> <span class="n">frame</span><span class="p">.</span><span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="ow">or</span> <span class="s1">''</span><span class="p">,</span> </span><span id="L-24"><a href="#L-24"><span class="linenos" data-line="24"></span></a> <span class="s1">'[</span><span class="se">\'</span><span class="s1">"&_]'</span><span class="p">,</span> </span><span id="L-25"><a href="#L-25"><span class="linenos" data-line="25"></span></a> <span class="p">{</span> </span><span id="L-26"><a href="#L-26"><span class="linenos" data-line="26"></span></a> <span class="p">[</span><span class="s2">"'"</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'&#39;'</span><span class="p">,</span> </span><span id="L-27"><a href="#L-27"><span class="linenos" data-line="27"></span></a> <span class="p">[</span><span class="s1">'"'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'&#34;'</span><span class="p">,</span> </span><span id="L-28"><a href="#L-28"><span class="linenos" data-line="28"></span></a> <span class="p">[</span><span class="s1">'&'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'&#38;'</span><span class="p">,</span> </span><span id="L-29"><a href="#L-29"><span class="linenos" data-line="29"></span></a> <span class="p">[</span><span class="s1">'_'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">' '</span><span class="p">,</span> </span><span id="L-30"><a href="#L-30"><span class="linenos" data-line="30"></span></a> <span class="p">}</span> </span><span id="L-31"><a href="#L-31"><span class="linenos" data-line="31"></span></a> <span class="p">)</span> </span><span id="L-32"><a href="#L-32"><span class="linenos" data-line="32"></span></a> <span class="kr">return</span> <span class="n">mw</span><span class="p">.</span><span class="n">text</span><span class="p">.</span><span class="n">trim</span><span class="p">(</span> <span class="n">x</span> <span class="p">)</span> </span><span id="L-33"><a href="#L-33"><span class="linenos" data-line="33"></span></a><span class="kr">end</span> </span><span id="L-34"><a href="#L-34"><span class="linenos" data-line="34"></span></a> </span><span id="L-35"><a href="#L-35"><span class="linenos" data-line="35"></span></a><span class="kr">return</span> <span class="n">p</span> </span></pre></div> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐f69cdc8f6‐l24nk Cached time: 20241124055403 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1] CPU time usage: 0.146 seconds Real time usage: 0.200 seconds Preprocessor visited node count: 368/1000000 Post‐expand include size: 13660/2097152 bytes Template argument size: 827/2097152 bytes Highest expansion depth: 10/100 Expensive parser function count: 4/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 7386/5000000 bytes Lua time usage: 0.103/10.000 seconds Lua memory usage: 1341574/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 117.607 1 Modul:StringReplace/dok 100.00% 117.607 1 -total 73.60% 86.557 1 Skabelon:High-risk 9.50% 11.169 1 Skabelon:Utilstrækkelig_vejledning 4.56% 5.357 1 Skabelon:Ukategoriseret 3.71% 4.359 1 Skabelon:Tl 3.62% 4.260 1 Skabelon:When_pagename_is 3.60% 4.229 2 Skabelon:Hønsedesign --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Hentet fra "<a dir="ltr" href="https://da.wikipedia.org/w/index.php?title=Modul:StringReplace&oldid=11752092">https://da.wikipedia.org/w/index.php?title=Modul:StringReplace&oldid=11752092</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Speciel:Kategorier" title="Speciel:Kategorier">Kategori</a>: <ul><li><a href="/wiki/Kategori:Moduler_uden_tilstr%C3%A6kkelig_vejledning" title="Kategori:Moduler uden tilstrækkelig vejledning">Moduler uden tilstrækkelig vejledning</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Skjulte kategorier: <ul><li><a href="/wiki/Kategori:Wikipedia_skabelon-beskyttede_moduler" title="Kategori:Wikipedia skabelon-beskyttede moduler">Wikipedia skabelon-beskyttede moduler</a></li><li><a href="/wiki/Kategori:Ukategoriserede_moduler" title="Kategori:Ukategoriserede moduler">Ukategoriserede moduler</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> Denne side blev senest ændret den 26. april 2024 kl. 16:06.</li> <li id="footer-info-copyright">Tekst er tilgængelig under <a rel="nofollow" class="external text" href="//creativecommons.org/licenses/by-sa/4.0/deed.da">Creative Commons Navngivelse/Del på samme vilkår 4.0</a>; yderligere betingelser kan være gældende. Se <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use/da">brugsbetingelserne</a> for flere oplysninger.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privatlivspolitik</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:Om">Om Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:Generelle_forbehold">Forbehold</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Udviklere</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/da.wikipedia.org">Statistik</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie-erklæring</a></li> <li id="footer-places-mobileview"><a href="//da.m.wikipedia.org/w/index.php?title=Modul:StringReplace&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobilvisning</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-l24nk","wgBackendResponseTime":489,"wgPageParseReport":{"limitreport":{"cputime":"0.146","walltime":"0.200","ppvisitednodes":{"value":368,"limit":1000000},"postexpandincludesize":{"value":13660,"limit":2097152},"templateargumentsize":{"value":827,"limit":2097152},"expansiondepth":{"value":10,"limit":100},"expensivefunctioncount":{"value":4,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":7386,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 117.607 1 Modul:StringReplace/dok","100.00% 117.607 1 -total"," 73.60% 86.557 1 Skabelon:High-risk"," 9.50% 11.169 1 Skabelon:Utilstrækkelig_vejledning"," 4.56% 5.357 1 Skabelon:Ukategoriseret"," 3.71% 4.359 1 Skabelon:Tl"," 3.62% 4.260 1 Skabelon:When_pagename_is"," 3.60% 4.229 2 Skabelon:Hønsedesign"]},"scribunto":{"limitreport-timeusage":{"value":"0.103","limit":"10.000"},"limitreport-memusage":{"value":1341574,"limit":52428800}},"cachereport":{"origin":"mw-web.codfw.main-f69cdc8f6-l24nk","timestamp":"20241124055403","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>