{"id":3546,"date":"2022-11-07T12:14:29","date_gmt":"2022-11-07T12:14:29","guid":{"rendered":"https:\/\/info.documotor.com\/?page_id=3546"},"modified":"2023-01-25T10:21:01","modified_gmt":"2023-01-25T10:21:01","slug":"replace","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=3546","title":{"rendered":"Replace"},"content":{"rendered":"\n<p>This function can be used to replace a given string with another string as part of a single string value or within an array or object.<\/p>\n\n\n\n<h3>Syntax<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">string replace(string $input, string $oldString, string $newString)<\/code><\/pre>\n\n\n\n<p>Replaces $oldString with $newString in $input.<\/p>\n\n\n\n<h3>Parameters<\/h3>\n\n\n\n<p><strong>$input:<\/strong> The string to split.<br><strong>$oldString:<\/strong> The string to replace.<br><strong>$newString: <\/strong>The string to replace the identified $oldString.<\/p>\n\n\n\n<h3>Example<\/h3>\n\n\n\n<pre title=\"Data\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n\t\"String\": \"Lorem Ipsum Dolor\"\n}<\/code><\/pre>\n\n\n\n<pre title=\"Transformation\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash line-numbers\">{\n\t\"NewString\": replace(String, 'Lorem Ipsum', 'Sit Amet')\n}<\/code><\/pre>\n\n\n\n<pre title=\"Output\" class=\"wp-block-code\"><code lang=\"json\" class=\"language-json line-numbers\">{\n\t\"NewString\": \"Sit Amet Dolor\"\n}<\/code><\/pre>\n\n\n\n<p>In this example the string value &#8220;String&#8221; has the string &#8220;Lorem Ipsum&#8221; replaced with the string &#8220;Sit Amet&#8221;.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This function can be used to replace a given string with another string as part of a single string value or within an array or object. Syntax Replaces $oldString with $newString in $input. Parameters $input: The string to split.$oldString: The string to replace.$newString: The string to replace the identified $oldString. Example In this example the [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"parent":271,"menu_order":170,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3546"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3546"}],"version-history":[{"count":6,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3546\/revisions"}],"predecessor-version":[{"id":4029,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/3546\/revisions\/4029"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/271"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}