{"id":330,"date":"2024-10-04T13:02:13","date_gmt":"2024-10-04T12:02:13","guid":{"rendered":"http:\/\/monkey.ploogie.co.uk\/?page_id=330"},"modified":"2024-10-04T13:02:13","modified_gmt":"2024-10-04T12:02:13","slug":"mwnci-replace-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-replace-function\/","title":{"rendered":"Mwnci replace() Function"},"content":{"rendered":"<h2><span id=\"Syntax\" class=\"mw-headline\">Syntax<\/span><\/h2>\n<p>replace(<i><b>string<\/b><\/i>, <i><b>search<\/b><\/i>, <i><b>replace<\/b><\/i>, n)<\/p>\n<h2><span id=\"Description\" class=\"mw-headline\">Description<\/span><\/h2>\n<p>The <i>replace()<\/i> function will replace the first <i>n<\/i> occurrences of <i>search<\/i> with <i>replace<\/i> and return the new <i>string<\/i>. If <i>n<\/i> &lt; 0, there is no limit on the number of replacements.<\/p>\n<h2><span id=\"Example\" class=\"mw-headline\">Example<\/span><\/h2>\n<pre>line=\"This is a senetnce\"\r\nline=replace(line, \"senetnce\", \"sentence\",1)\r\nprintln(line)\r\n\r\n\r\nThis is a sentence\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax replace(string, search, replace, n) Description The replace() function will replace the first n occurrences of search with replace and return the new string. If n &lt; 0, there is no limit on the number of replacements. Example line=&#8221;This is a senetnce&#8221; line=replace(line, &#8220;senetnce&#8221;, &#8220;sentence&#8221;,1) println(line) This is a sentence<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-330","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=330"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/330\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/330\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}