{"id":894,"date":"2024-12-12T13:50:48","date_gmt":"2024-12-12T13:50:48","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=894"},"modified":"2024-12-12T13:53:03","modified_gmt":"2024-12-12T13:53:03","slug":"mwnci-interpol-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-interpol-function\/","title":{"rendered":"Mwnci interpol() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>interpol<strong>(<em>hash<\/em>,<em>string<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>interpol()<\/i> function returns a string with tokenised names replaced by the hash token value.<\/p>\n<h2>Example<\/h2>\n<pre>\r\ndata=[{\"Name\": \"Jim Spriggs\", \"Age\": 70, \"Address\": \"10 Bushy Spon\"},\r\n      {\"Name\": \"Ned Seagoon\", \"Age\": 50, \"Address\": \"No. 4, The Dustbin\"}\r\n]\r\ntext=\"${Name} is aged ${Age} and lives at ${Address}\"\r\nforeach entry in data {\r\n    println(interpol(entry, text))\r\n}\r\n\r\n\r\nJim Spriggs is aged 70 and lives at 10 Bushy Spon\r\nNed Seagoon is aged 50 and lives at No. 4, The Dustbin\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax interpol(hash,string) Description The interpol() function returns a string with tokenised names replaced by the hash token value. Example data=[{&#8220;Name&#8221;: &#8220;Jim Spriggs&#8221;, &#8220;Age&#8221;: 70, &#8220;Address&#8221;: &#8220;10 Bushy Spon&#8221;}, {&#8220;Name&#8221;: &#8220;Ned Seagoon&#8221;, &#8220;Age&#8221;: 50, &#8220;Address&#8221;: &#8220;No. 4, The Dustbin&#8221;} ] text=&#8221;${Name} is aged ${Age} and lives at ${Address}&#8221; foreach entry in data { println(interpol(entry, text)) } &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-interpol-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci interpol() Function&#8221;<\/span><\/a><\/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-894","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/894","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=894"}],"version-history":[{"count":4,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/894\/revisions"}],"predecessor-version":[{"id":899,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/894\/revisions\/899"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}