CINXE.COM
Ver el código de «Módulo:String2» - Wikipedia, la enciclopedia libre
<!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-disabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-not-available" lang="es" dir="ltr"> <head> <meta charset="UTF-8"> <title>Ver el código de «Módulo:String2» - Wikipedia, la enciclopedia libre</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-disabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-not-available";var cookie=document.cookie.match(/(?:^|; )eswikimwclientpreferences=([^;]+)/);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":true,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat": "dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"4f73c448-8aef-4277-94ff-789c5b576b5f","wgCanonicalNamespace":"Module","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":828,"wgPageName":"Módulo:String2","wgTitle":"String2","wgCurRevisionId":145407788,"wgRevisionId":0,"wgArticleId":10310234,"wgIsArticle":false,"wgIsRedirect":false,"wgAction":"edit","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"Scribunto","wgRelevantPageName":"Módulo:String2","wgRelevantArticleId":10310234,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":[],"wgRestrictionMove":[],"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":10000,"wgCodeEditorCurrentLanguage":"lua","wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":true,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.gadget.imagenesinfobox":"ready","ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading", "ext.codeEditor.styles":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.charinsert.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.codeEditor","ext.scribunto.edit","mediawiki.action.edit.collapsibleFooter","site","mediawiki.page.ready","skins.vector.js","ext.centralNotice.geoIP","ext.charinsert","ext.gadget.a-commons-directo","ext.gadget.ReferenceTooltips","ext.gadget.refToolbar","ext.gadget.switcher","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","ext.checkUser.clientHints","wikibase.sidebar.tracking"];</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=es&modules=ext.charinsert.styles%7Cext.codeEditor.styles%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=es&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=es&modules=ext.gadget.imagenesinfobox&only=styles&skin=vector-2022"> <link rel="stylesheet" href="/w/load.php?lang=es&modules=site.styles&only=styles&skin=vector-2022"> <noscript><link rel="stylesheet" href="/w/load.php?lang=es&modules=noscript&only=styles&skin=vector-2022"></noscript> <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="noindex,nofollow,max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Ver el código de «Módulo:String2» - Wikipedia, la enciclopedia libre"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//es.m.wikipedia.org/wiki/M%C3%B3dulo:String2"> <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 (es)"> <link rel="EditURI" type="application/rsd+xml" href="//es.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://es.wikipedia.org/wiki/M%C3%B3dulo:String2"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.es"> <link rel="alternate" type="application/atom+xml" title="Canal Atom de Wikipedia" href="/w/index.php?title=Especial:CambiosRecientes&feed=atom"> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="codeeditor-loading skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-828 ns-subject page-Módulo_String2 rootpage-Módulo_String2 skin-vector-2022 action-edit"><a class="mw-jump-link" href="#bodyContent">Ir al contenido</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="Sitio"> <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="Menú principal" > <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">Menú principal</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">Menú principal</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">mover a la barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">ocultar</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navegación </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Wikipedia:Portada" title="Visitar la página principal [z]" accesskey="z"><span>Portada</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Portal:Comunidad" title="Acerca del proyecto, lo que puedes hacer, dónde encontrar información"><span>Portal de la comunidad</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Portal:Actualidad" title="Encuentra información de contexto sobre acontecimientos actuales"><span>Actualidad</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Especial:CambiosRecientes" title="Lista de cambios recientes en la wiki [r]" accesskey="r"><span>Cambios recientes</span></a></li><li id="n-newpages" class="mw-list-item"><a href="/wiki/Especial:P%C3%A1ginasNuevas"><span>Páginas nuevas</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Especial:Aleatoria" title="Cargar una página al azar [x]" accesskey="x"><span>Página aleatoria</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/Ayuda:Contenidos" title="El lugar para aprender"><span>Ayuda</span></a></li><li id="n-bug_in_article" class="mw-list-item"><a href="/wiki/Wikipedia:Informes_de_error"><span>Notificar un error</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Wikipedia:Portada" 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="La enciclopedia libre" src="/static/images/mobile/copyright/wikipedia-tagline-es.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/Especial:Buscar" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Buscar en este wiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Buscar</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="Buscar en Wikipedia" aria-label="Buscar en Wikipedia" autocapitalize="sentences" title="Buscar en este wiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Especial:Buscar"> </div> <button class="cdx-button cdx-search-input__end-button">Buscar</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Herramientas personales"> <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="Apariencia"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <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="Apariencia" > <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">Apariencia</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_es.wikipedia.org&uselang=es" class=""><span>Donaciones</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=Especial:Crear_una_cuenta&returnto=M%C3%B3dulo%3AString2&returntoquery=action%3Dedit" title="Te recomendamos crear una cuenta e iniciar sesión; sin embargo, no es obligatorio" class=""><span>Crear una cuenta</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=Especial:Entrar&returnto=M%C3%B3dulo%3AString2&returntoquery=action%3Dedit" title="Te recomendamos iniciar sesión, aunque no es obligatorio [o]" accesskey="o" class=""><span>Acceder</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" title="Más opciones" > <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="Herramientas personales" > <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">Herramientas personales</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Menú de usuario" > <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_es.wikipedia.org&uselang=es"><span>Donaciones</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Especial:Crear_una_cuenta&returnto=M%C3%B3dulo%3AString2&returntoquery=action%3Dedit" title="Te recomendamos crear una cuenta e iniciar sesión; sin embargo, no es obligatorio"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Crear una cuenta</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Especial:Entrar&returnto=M%C3%B3dulo%3AString2&returntoquery=action%3Dedit" title="Te recomendamos iniciar sesión, aunque no es obligatorio [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Acceder</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Páginas para editores desconectados <a href="/wiki/Ayuda:Introducci%C3%B3n" aria-label="Obtenga más información sobre editar"><span>más información</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Especial:MisContribuciones" title="Una lista de modificaciones hechas desde esta dirección IP [y]" accesskey="y"><span>Contribuciones</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Especial:MiDiscusi%C3%B3n" title="Discusión sobre ediciones hechas desde esta dirección IP [n]" accesskey="n"><span>Discusión</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"><!-- CentralNotice --></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="Sitio"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <h1 id="firstHeading" class="firstHeading mw-first-heading">Ver el código de «Módulo:String2»</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="Este artículo existe sólo en este idioma. Añade el artículo para otros idiomas" > <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-0" 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">Añadir idiomas</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="uls-after-portlet-link"></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Espacios de nombres"> <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/M%C3%B3dulo:String2" title="Ver la página del módulo [c]" accesskey="c"><span>Módulo</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=M%C3%B3dulo_discusi%C3%B3n:String2&action=edit&redlink=1" rel="discussion" class="new" title="Discusión acerca de la página (aún no redactado) [t]" accesskey="t"><span>Discusión</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="Cambiar variante de idioma" > <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="Vistas"> <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="vector-tab-noicon mw-list-item"><a href="/wiki/M%C3%B3dulo:String2"><span>Leer</span></a></li><li id="ca-viewsource" class="selected vector-tab-noicon mw-list-item"><a href="/w/index.php?title=M%C3%B3dulo:String2&action=edit" title="Esta página está protegida, pero puedes ver su código fuente [e]" accesskey="e"><span>Ver código fuente</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=M%C3%B3dulo:String2&action=history" title="Versiones anteriores de esta página [h]" accesskey="h"><span>Ver historial</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Página de herramientas"> <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="Herramientas" > <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">Herramientas</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">Herramientas</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">mover a la barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">ocultar</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Más opciones" > <div class="vector-menu-heading"> Acciones </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="vector-more-collapsible-item mw-list-item"><a href="/wiki/M%C3%B3dulo:String2"><span>Leer</span></a></li><li id="ca-more-viewsource" class="selected vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=M%C3%B3dulo:String2&action=edit"><span>Ver código fuente</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=M%C3%B3dulo:String2&action=history"><span>Ver historial</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Especial:LoQueEnlazaAqu%C3%AD/M%C3%B3dulo:String2" title="Lista de todas las páginas de la wiki que enlazan aquí [j]" accesskey="j"><span>Lo que enlaza aquí</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Especial:CambiosEnEnlazadas/M%C3%B3dulo:String2" rel="nofollow" title="Cambios recientes en las páginas que enlazan con esta [k]" accesskey="k"><span>Cambios en enlazadas</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard?uselang=es" title="Subir archivos [u]" accesskey="u"><span>Subir archivo</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Especial:P%C3%A1ginasEspeciales" title="Lista de todas las páginas especiales [q]" accesskey="q"><span>Páginas especiales</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=M%C3%B3dulo:String2&action=info" title="Más información sobre esta página"><span>Información de la página</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Especial:Acortador_de_URL&url=https%3A%2F%2Fes.wikipedia.org%2Fw%2Findex.php%3Ftitle%3DM%25C3%25B3dulo%3AString2%26action%3Dedit"><span>Obtener URL acortado</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Especial:QrCode&url=https%3A%2F%2Fes.wikipedia.org%2Fw%2Findex.php%3Ftitle%3DM%25C3%25B3dulo%3AString2%26action%3Dedit"><span>Descargar código QR</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"> En otros proyectos </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/Q16914835" title="Enlace al elemento conectado del repositorio de datos [g]" accesskey="g"><span>Elemento de Wikidata</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="Página de herramientas"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Apariencia"> <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">Apariencia</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">mover a la barra lateral</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">ocultar</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> </div> <div id="contentSub"><div id="mw-content-subtitle">← <a href="/wiki/M%C3%B3dulo:String2" title="Módulo:String2">Módulo:String2</a></div></div> <div id="mw-content-text" class="mw-body-content"><p>No tienes permiso para modificar esta página, por las siguientes razones: </p> <ul class="permissions-errors"><li class="mw-permissionerror-namespaceprotected">No tienes permiso para editar las páginas del espacio de nombres <strong>Módulo</strong>.</li><li class="mw-permissionerror-blockedtext">Tu cuenta de usuario o dirección IP ha sido <a href="/wiki/Wikipedia:Pol%C3%ADtica_de_bloqueo" class="mw-redirect" title="Wikipedia:Política de bloqueo">bloqueada</a> por <a href="/wiki/Usuario:BlockBot-es" title="Usuario:BlockBot-es">BlockBot-es</a>. Esto solo te impide modificar las páginas, no leerlas. La razón dada es <b><i></i></b><div class="usuario bloqueado - webhost" style="margin-bottom: 0.5em; background-color: #ffefd5; border: 1px solid #AAA; padding: 0.7em;"><b><i></i></b> <figure class="mw-halign-left" typeof="mw:File"><span><img src="//upload.wikimedia.org/wikipedia/commons/thumb/5/53/Server-multiple.svg/40px-Server-multiple.svg.png" decoding="async" width="40" height="57" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/53/Server-multiple.svg/60px-Server-multiple.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/53/Server-multiple.svg/80px-Server-multiple.svg.png 2x" data-file-width="744" data-file-height="1052" /></span><figcaption></figcaption></figure><b>Esta <a href="/wiki/Direcci%C3%B3n_IP" title="Dirección IP">dirección IP</a> está bloqueada en Wikipedia en español porque está identificada como un <a href="/wiki/Alojamiento_web" title="Alojamiento web">proveedor de alojamiento web</a>.</b> Para prevenir abusos, <a href="/wiki/Wikipedia:Proxies_abiertos" title="Wikipedia:Proxies abiertos">los servicios de alojamiento web pueden ser bloqueados</a> de editar en Wikipedia en virtud de la política global sobre la materia. <div style="border-top: 1px solid #AAA; clear: both">No puedes editar Wikipedia en español usando un servicio de alojamiento web porque oculta tu dirección IP de igual forma que un <a href="/wiki/Servidor_proxy" title="Servidor proxy">proxy</a> o <a href="/wiki/VPN" class="mw-redirect" title="VPN">VPN</a>. <p><b>Recomendamos que intentes usar otra conexión para editar.</b> Por ejemplo, si usas un proxy o VPN para conectarte a Internet, apágalo cuando edites Wikipedia. Si editas usando una red móvil, intenta usar una conexión Wi-Fi, y viceversa. Si tienes una cuenta registrada en Wikipedia, por favor logueate; si el bloqueo persiste, necesitarás <a href="/wiki/Wikipedia:EBI" class="mw-redirect" title="Wikipedia:EBI">una exención de bloqueo a IP</a>. </p><p>Si estás seguro de que no estás usando un servicio de alojamiento web para editar, puedes <a href="/wiki/Ayuda:Gu%C3%ADa_para_apelar_bloqueos" title="Ayuda:Guía para apelar bloqueos">apelar este bloqueo</a> añadiendo el siguiente texto en tu <a href="/wiki/Ayuda:P%C3%A1gina_de_discusi%C3%B3n" class="mw-redirect" title="Ayuda:Página de discusión">página de discusión</a>: <code>{{<a href="/wiki/Plantilla:Desbloquear" title="Plantilla:Desbloquear">Desbloquear</a>|razón=Estoy afectado por un bloqueo a un servicio de alojamiento web, pero este proveedor o dirección IP no lo es. Mi dirección IP es _______. <i>Agrega cualquier otra información aquí.</i> ~~~~}}</code>. <b>Debes rellenar el espacio en blanco con tu dirección IP para que este bloqueo sea investigado.</b> Puedes ver tu dirección IP <span class="plainlinks"><b><a class="external text" href="https://en.wikipedia.org/wiki/Wikipedia:Get_my_IP_address?withJS=MediaWiki:Get-my-ip.js">en este enlace</a></b></span>. Hay varias razones por las cuales puedes estar editando usando la dirección IP de un servicio de alojamiento web (tales como usar una VPN o red empresarial); por favor únicamente apela este bloqueo si tu dirección IP no forma parte de un servicio de alojamiento web. </p><p><span class="sysop-show para_biblios" style="font-size: 85%;"><span style="border:#707070 solid 1px;background-color:#ffe0e0;padding:2px"><b>Bibliotecarios:</b></span> El permiso <a href="/wiki/Wikipedia:EBI" class="mw-redirect" title="Wikipedia:EBI">exención de bloqueo a IP</a> solo debe otorgarse a usuarios registrados que editan a través de servicios de alojamiento web en circunstancias excepcionales. Si pretendes otorgar el permiso, un <a href="/wiki/Wikipedia:CU" class="mw-redirect" title="Wikipedia:CU">CheckUser</a> podría necesitar revisar la cuenta. <b>Desbloquear</b> una IP o rango de IPs con esta plantilla <b>está altamente desaconsejado</b> sin que antes, por lo menos, contactes con el usuario que aplicó el bloqueo o con un checkuser.</span> </p> </div></div>. Visita <a href="/wiki/Wikipedia:Proxies_abiertos" title="Wikipedia:Proxies abiertos">la página informativa</a> si estás afectado. <b><i>.<br />Puedes contactar a <a href="/wiki/Usuario:BlockBot-es" title="Usuario:BlockBot-es">BlockBot-es</a> o a otro de los <a href="/wiki/Especial:ListaUsuarios/sysop" title="Especial:ListaUsuarios/sysop">bibliotecarios</a> para</i></b> <p>discutir el bloqueo: </p> <ul><li>Colocando <tt>{{desbloquear|motivo por el que deberías ser desbloqueado}}</tt> en <a href="/wiki/Especial:MiDiscusi%C3%B3n" title="Especial:MiDiscusión">tu página de discusión</a> (que puedes seguir editando). Es <b>muy importante</b> especificar un motivo <b>válido</b>.</li> <li>Enviando un correo electrónico a un bibliotecario usando el enlace <i>Enviar correo electrónico a este usuario</i> que aparece en el bloque de herramientas de la izquierda al ver su página. No puedes usar este método si no estás registrado y no tienes una dirección confirmada de correo electrónico en tus <a href="/wiki/Especial:Preferencias" title="Especial:Preferencias">preferencias</a>.<br />Ten en cuenta que puede suceder que, al ser bloqueado, se te deshabilite la capacidad de hacer uso de esta herramienta. En estos casos la única manera de discutir el bloqueo será la primera mencionada.</li></ul> Tu dirección IP actual es <b>8.222.208.146</b>, y el identificador del bloqueo es <b>#4880382</b>.</li><li class="mw-permissionerror-globalblocking-blockedtext-range"><b>Tu dirección IP forma parte de un rango de direcciones que se encuentra <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Global_blocks" class="extiw" title="m:Special:MyLanguage/Global blocks">bloqueado en todas las wikis de Wikimedia</a>.</b> El bloqueo fue realizado por <a href="/wiki/Usuario:Jon_Kolbert" title="Usuario:Jon Kolbert">Jon Kolbert</a>. El motivo es <i><a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/NOP" class="extiw" title="m:Special:MyLanguage/NOP">Open proxy/Webhost</a>: See the <a href="https://meta.wikimedia.org/wiki/WM:OP/H" class="extiw" title="m:WM:OP/H">help page</a> if you are affected </i>. <ul><li>Inicio del bloqueo: 15:12 27 ago 2023</li> <li>Caducidad del bloqueo: 15:12 27 ago 2028</li></ul> Tu dirección IP es 8.222.208.146. El intervalo bloqueado es 8.222.128.0/17. Por favor indica todos los datos aquí mostrados en cualquier consulta que hagas. Si crees que este bloqueo es incorrecto, puedes encontrar información e instrucciones adicionales en la política global de <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/No_open_proxies" class="extiw" title="m:Special:MyLanguage/No open proxies">prohibición de proxies abiertos</a>. También puedes <a href="https://meta.wikimedia.org/wiki/Steward_requests/Global" class="extiw" title="m:Steward requests/Global">solicitar una revisión de este bloqueo en Meta-Wiki</a>. También puede enviar un correo electrónico a la cola <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/VRT" class="extiw" title="m:Special:MyLanguage/VRT">VRT</a> de <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Stewards" class="extiw" title="m:Special:MyLanguage/Stewards">stewards</a> a <kbd>stewards@wikimedia.org</kbd> incluyendo todos los detalles anteriores.</li></ul><hr /> <p>Puedes ver y copiar el código fuente de esta página. </p><textarea readonly="" accesskey="," id="wpTextbox1" cols="80" rows="25" style="" class="mw-editfont-monospace" lang="en" dir="ltr" name="wpTextbox1">local p = {} p.trim = function(frame) return mw.text.trim(frame.args[1] or "") end p.sentence = function (frame) -- {{lc:}} is strip-marker safe, string.lower is not. frame.args[1] = frame:callParserFunction('lc', frame.args[1]) return p.ucfirst(frame) end p.ucfirst = function (frame ) local s = mw.text.trim( frame.args[1] or "" ) local s1 = "" -- if it's a list chop off and (store as s1) everything up to the first <li> local lipos = mw.ustring.find(s, "<li>" ) if lipos then s1 = mw.ustring.sub(s, 1, lipos + 3) s = mw.ustring.sub(s, lipos + 4) end -- s1 is either "" or the first part of the list markup, so we can continue -- and prepend s1 to the returned string local letterpos if mw.ustring.find(s, "^%[%[[^|]+|[^%]]+%]%]") then -- this is a piped wikilink, so we capitalise the text, not the pipe local _ _, letterpos = mw.ustring.find(s, "|%W*%w") -- find the first letter after the pipe else letterpos = mw.ustring.find(s, '%w') end if letterpos then local first = mw.ustring.sub(s, 1, letterpos - 1) local letter = mw.ustring.sub(s, letterpos, letterpos) local rest = mw.ustring.sub(s, letterpos + 1) return s1 .. first .. mw.ustring.upper(letter) .. rest else return s1 .. s end end p.title = function (frame ) -- http://grammar.yourdictionary.com/capitalization/rules-for-capitalization-in-titles.html -- recommended by The U.S. Government Printing Office Style Manual: -- "Capitalize all words in titles of publications and documents, -- except a, an, the, at, by, for, in, of, on, to, up, and, as, but, or, and nor." local alwayslower = {['a'] = 1, ['an'] = 1, ['the'] = 1, ['and'] = 1, ['but'] = 1, ['or'] = 1, ['for'] = 1, ['nor'] = 1, ['on'] = 1, ['in'] = 1, ['at'] = 1, ['to'] = 1, ['from'] = 1, ['by'] = 1, ['of'] = 1, ['up'] = 1 } local res = '' local s = mw.text.trim( frame.args[1] or "" ) local words = mw.text.split( s, " ") for i, s in ipairs(words) do -- {{lc:}} is strip-marker safe, string.lower is not. s = frame:callParserFunction('lc', s) if i == 1 or alwayslower[s] ~= 1 then s = mw.getContentLanguage():ucfirst(s) end words[i] = s end return table.concat(words, " ") end -- findlast finds the last item in a list -- the first unnamed parameter is the list -- the second, optional unnamed parameter is the list separator (default = comma space) -- returns the whole list if separator not found p.findlast = function(frame) local s = mw.text.trim( frame.args[1] or "" ) local sep = frame.args[2] or "" if sep == "" then sep = ", " end local pattern = ".*" .. sep .. "(.*)" local a, b, last = s:find(pattern) if a then return last else return s end end -- stripZeros finds the first number and strips leading zeros (apart from units) -- e.g "0940" -> "940"; "Year: 0023" -> "Year: 23"; "00.12" -> "0.12" p.stripZeros = function(frame) local s = mw.text.trim(frame.args[1] or "") local n = tonumber( string.match( s, "%d+" ) ) or "" s = string.gsub( s, "%d+", n, 1 ) return s end -- nowiki ensures that a string of text is treated by the MediaWiki software as just a string -- it takes an unnamed parameter and trims whitespace, then removes any wikicode p.nowiki = function(frame) local str = mw.text.trim(frame.args[1] or "") return mw.text.nowiki(str) end -- split splits text at boundaries specified by separator -- and returns the chunk for the index idx (starting at 1) -- #invoke:String2 |split |text |separator |index |true/false -- #invoke:String2 |split |txt=text |sep=separator |idx=index |plain=true/false -- if plain is false/no/0 then separator is treated as a Lua pattern - defaults to plain=true p.split = function(frame) local args = frame.args if not(args[1] or args.txt) then args = frame:getParent().args end local txt = args[1] or args.txt or "" if txt == "" then return nil end local sep = (args[2] or args.sep or ""):gsub('"', '') local idx = tonumber(args[3] or args.idx) or 1 local plain = (args[4] or args.plain or "true"):sub(1,1) plain = (plain ~= "f" and plain ~= "n" and plain ~= "0") local splittbl = mw.text.split( txt, sep, plain ) if idx < 0 then idx = #splittbl + idx + 1 end return splittbl[idx] end -- val2percent scans through a string, passed as either the first unnamed parameter or |txt= -- it converts each number it finds into a percentage and returns the resultant string. p.val2percent = function(frame) local args = frame.args if not(args[1] or args.txt) then args = frame:getParent().args end local txt = mw.text.trim(args[1] or args.txt or "") if txt == "" then return nil end local function v2p (x) x = (tonumber(x) or 0) * 100 if x == math.floor(x) then x = math.floor(x) end return x .. "%" end txt = txt:gsub("%d[%d%.]*", v2p) -- store just the string return txt end -- one2a scans through a string, passed as either the first unnamed parameter or |txt= -- it converts each occurrence of 'one ' into either 'a ' or 'an ' and returns the resultant string. p.one2a = function(frame) local args = frame.args if not(args[1] or args.txt) then args = frame:getParent().args end local txt = mw.text.trim(args[1] or args.txt or "") if txt == "" then return nil end txt = txt:gsub(" one ", " a "):gsub("^one", "a"):gsub("One ", "A "):gsub("a ([aeiou])", "an %1"):gsub("A ([aeiou])", "An %1") return txt end -- findpagetext returns the position of a piece of text in a page -- First positional parameter or |text is the search text -- Optional parameter |title is the page title, defaults to current page -- Optional parameter |plain is either true for plain search (default) or false for Lua pattern search -- Optional parameter |nomatch is the return value when no match is found; default is nil p._findpagetext = function(args) -- process parameters local nomatch = args.nomatch or "" if nomatch == "" then nomatch = nil end -- local text = mw.text.trim(args[1] or args.text or "") if text == "" then return nil end -- local title = args.title or "" local titleobj if title == "" then titleobj = mw.title.getCurrentTitle() else titleobj = mw.title.new(title) end -- local plain = args.plain or "" if plain:sub(1, 1) == "f" then plain = false else plain = true end -- get the page content and look for 'text' - return position or nomatch local content = titleobj and titleobj:getContent() return content and mw.ustring.find(content, text, 1, plain) or nomatch end p.findpagetext = function(frame) local args = frame.args local pargs = frame:getParent().args for k, v in pairs(pargs) do args[k] = v end if not (args[1] or args.text) then return nil end -- just the first value return (p._findpagetext(args)) end -- returns the decoded url. Inverse of parser function {{urlencode:val|TYPE}} -- Type is: -- QUERY decodes + to space (default) -- PATH does no extra decoding -- WIKI decodes _ to space p._urldecode = function(url, type) url = url or "" type = (type == "PATH" or type == "WIKI") and type return mw.uri.decode( url, type ) end -- {{#invoke:String2|urldecode|url=url|type=type}} p.urldecode = function(frame) return mw.uri.decode( frame.args.url, frame.args.type ) end -- what follows was merged from Module:StringFunc -- helper functions p._GetParameters = require('Module:GetParameters') -- Argument list helper function, as per Module:String p._getParameters = p._GetParameters.getParameters -- Escape Pattern helper function so that all characters are treated as plain text, as per Module:String function p._escapePattern( pattern_str) return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ) end -- Helper Function to interpret boolean strings, as per Module:String p._getBoolean = p._GetParameters.getBoolean --[[ Strip This function Strips characters from string Usage: {{#invoke:String2|strip|source_string|characters_to_strip|plain_flag}} Parameters source: The string to strip chars: The pattern or list of characters to strip from string, replaced with '' plain: A flag indicating that the chars should be understood as plain text. defaults to true. Leading and trailing whitespace is also automatically stripped from the string. ]] function p.strip( frame ) local new_args = p._getParameters( frame.args, {'source', 'chars', 'plain'} ) local source_str = new_args['source'] or '' local chars = new_args['chars'] or '' or 'characters' source_str = mw.text.trim(source_str) if source_str == '' or chars == '' then return source_str end local l_plain = p._getBoolean( new_args['plain'] or true ) if l_plain then chars = p._escapePattern( chars ) end local result result = mw.ustring.gsub(source_str, "["..chars.."]", '') return result end --[[ Match any Returns the index of the first given pattern to match the input. Patterns must be consecutively numbered. Returns the empty string if nothing matches for use in {{#if:}} Usage: {{#invoke:String2|matchAll|source=123 abc|456|abc}} returns '2'. Parameters: source: the string to search plain: A flag indicating that the patterns should be understood as plain text. defaults to true. 1, 2, 3, ...: the patterns to search for ]] function p.matchAny(frame) local source_str = frame.args['source'] or error('The source parameter is mandatory.') local l_plain = p._getBoolean( frame.args['plain'] or true ) for i = 1, math.huge do local pattern = frame.args[i] if not pattern then return '' end if mw.ustring.find(source_str, pattern, 1, l_plain) then return tostring(i) end end end --[[--------------------------< H Y P H E N _ T O _ D A S H >-------------------------------------------------- Converts a hyphen to a dash under certain conditions. The hyphen must separate like items; unlike items are returned unmodified. These forms are modified: letter - letter (A - B) digit - digit (4-5) digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5) letterdigit - letterdigit (A1-A5) (an optional separator between letter and digit is supported – a.1-a.5 or a-1-a-5) digitletter - digitletter (5a - 5d) (an optional separator between letter and digit is supported – 5.a-5.d or 5-a-5-d) any other forms are returned unmodified. str may be a comma- or semicolon-separated list ]] function p.hyphen_to_dash( str, spacing ) if (str == nil or str == '') then return str end local accept str = mw.text.decode(str, true ) -- replace html entities with their characters; semicolon mucks up the text.split local out = {} local list = mw.text.split (str, '%s*[,;]%s*') -- split str at comma or semicolon separators if there are any for _, item in ipairs (list) do -- for each item in the list item = mw.text.trim(item) -- trim whitespace item, accept = item:gsub ('^%(%((.+)%)%)$', '%1') if accept == 0 and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit) item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter) item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2') -- replace hyphen, remove extraneous space characters else item = mw.ustring.gsub (item, '%s*[–—]%s*', '–') -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace end end table.insert (out, item) -- add the (possibly modified) item to the output table end local temp_str = table.concat (out, ',' .. spacing) -- concatenate the output table into a comma separated string temp_str, accept = temp_str:gsub ('^%(%((.+)%)%)$', '%1') -- remove accept-this-as-written markup when it wraps all of concatenated out if accept ~= 0 then temp_str = str:gsub ('^%(%((.+)%)%)$', '%1') -- when global markup removed, return original str; do it this way to suppress boolean second return value end return temp_str end function p.hyphen2dash( frame ) local str = frame.args[1] or '' local spacing = frame.args[2] or ' ' -- space is part of the standard separator for normal spacing (but in conjunction with templates r/rp/ran we may need a narrower spacing return p.hyphen_to_dash(str, spacing) end -- Similar to [[Module:String#endswith]] function p.startswith(frame) return (frame.args[1]:sub(1, frame.args[2]:len()) == frame.args[2]) and 'yes' or '' end return p </textarea><div id="mw-scribunto-console"></div><div class="templatesUsed"><div class="mw-templatesUsedExplanation"><p>Plantillas usadas en esta página: </p></div><ul> <li><a href="/wiki/Plantilla:Documentaci%C3%B3n/caja_inicial" title="Plantilla:Documentación/caja inicial">Plantilla:Documentación/caja inicial</a> (<a href="/w/index.php?title=Plantilla:Documentaci%C3%B3n/caja_inicial&action=edit" title="Plantilla:Documentación/caja inicial">ver código</a>) (protegida para editores de plantillas)</li><li><a href="/wiki/Plantilla:Em" title="Plantilla:Em">Plantilla:Em</a> (<a href="/w/index.php?title=Plantilla:Em&action=edit" title="Plantilla:Em">ver código</a>) (semiprotegida)</li><li><a href="/wiki/Plantilla:Ml" class="mw-redirect" title="Plantilla:Ml">Plantilla:Ml</a> (<a href="/w/index.php?title=Plantilla:Ml&action=edit" class="mw-redirect" title="Plantilla:Ml">editar</a>) </li><li><a href="/wiki/Plantilla:Precarga_enlaces_en_rojo" title="Plantilla:Precarga enlaces en rojo">Plantilla:Precarga enlaces en rojo</a> (<a href="/w/index.php?title=Plantilla:Precarga_enlaces_en_rojo&action=edit" title="Plantilla:Precarga enlaces en rojo">ver código</a>) (semiprotegida)</li><li><a href="/w/index.php?title=M%C3%B3dulo:String2/doc&action=edit&redlink=1" class="new" title="Módulo:String2/doc (aún no redactado)">Módulo:String2/doc</a> (<a href="/w/index.php?title=M%C3%B3dulo:String2/doc&action=edit" class="new" title="Módulo:String2/doc (aún no redactado)">ver código</a>) </li></ul></div><p id="mw-returnto">Volver a <a href="/wiki/M%C3%B3dulo:String2" title="Módulo:String2">Módulo:String2</a>.</p> <!--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="">Obtenido de «<a dir="ltr" href="https://es.wikipedia.org/wiki/Módulo:String2">https://es.wikipedia.org/wiki/Módulo:String2</a>»</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy/es">Política de privacidad</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:Acerca_de">Acerca de Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:Limitaci%C3%B3n_general_de_responsabilidad">Limitación de responsabilidad</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Código de conducta</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Desarrolladores</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/es.wikipedia.org">Estadísticas</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement/es">Declaración de cookies</a></li> <li id="footer-places-mobileview"><a href="//es.m.wikipedia.org/w/index.php?title=M%C3%B3dulo:String2&action=edit&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Versión para móviles</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-zlb24","wgBackendResponseTime":194,"wgPageParseReport":{"limitreport":{"cputime":"0.020","walltime":"0.029","ppvisitednodes":{"value":76,"limit":1000000},"postexpandincludesize":{"value":4206,"limit":2097152},"templateargumentsize":{"value":465,"limit":2097152},"expansiondepth":{"value":7,"limit":100},"expensivefunctioncount":{"value":0,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":60,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 7.135 1 -total","100.00% 7.135 1 Plantilla:Webhost_bloqueado"," 54.46% 3.886 1 Plantilla:Tlx"]},"cachereport":{"origin":"mw-web.codfw.main-f69cdc8f6-zlb24","timestamp":"20241125042427","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>